Taswar Bhatti
The synonyms of software simplicity
Tag: programming

Was going through some legacy code recently and found a big for loop that had multiple switch statement inside. So being that I hate something that is fairly large, every method should be small and concise, I went along to refactor it to SRP. This code is generic so you might see something like this […]


Here is some poorly written code that I had to review today and modify (i.e refactor). I have removed the domain of the code and renamed the variables, so that it remains anonymous, but the just of the code is still intact.

Lets go through the inner loop of the code first. First the […]


You are here beacause you probably got a Linq error, specifically Operator ‘==’ cannot be applied to operands of type ‘System.Collections.Generic.KeyValuePair‘ and ‘‘ So if you wish to do something like this to KeyValuePair using Linq

You will get this error Operator ‘!=’ cannot be applied to operands of type ‘System.Collections.Generic.KeyValuePair‘ and ‘‘ Since […]