Refactor “if” statements – functional programming style

Have you ever seen code that look like this: public string GetStatusDescription(Model model){ if(model.HasProblemReports) { return "Errors"; } if(model.SystemState.WorkingMode == WorkingMode.NotManaged) { return "Manual"; } if(model.SystemState.IsInitializing) { return "Initialize"; } if(!model.SystemState.InService) { return "Not in service"; } if(model.SystemState.WorkingMode == WorkingMode.Paused) { return "Paused"; } if(model.Storage.Objects.Any(obj => obj.IsMoving)) { return "Movement in storage"; } return string.Empty;}I … Continue reading Refactor “if” statements – functional programming style

Three .NET "tools" that I use every day and you want to know about

Time is a very limited and expensive resource. As a software developer I feel more often than not that I just don’t have enough of it…That’s why whenever I find a new library or tool that save me time I embrace it with both hands, especially if they preform tasks that I find boring and … Continue reading Three .NET "tools" that I use every day and you want to know about