C# · Dotnet

Generic method to avoid long IF clauses

Dear Reader, Recently at work, i was working with a library which had lot of properties wherein they must be verified for its Truth value before exporting or importing respective attributes to file or back to UI respectively. Basically, the raw code initially looked roughly like below: void ExampleMethod() { SomeType type = new SomeType();… Continue reading Generic method to avoid long IF clauses

C# · CodeProject · Dotnet

Decision matrix implementation in C#

Dear Reader, Yesterday i faced a problem where the combinations possibilities were many and i had to implement code for this problem. Obvious solution is to implement If – else ladder. But i absolute hate this solution because the combination were around 5C3. The combination data was about behavior aspect of a scenario. Next solution… Continue reading Decision matrix implementation in C#

C# · Dotnet

Better if feature wise subclassing

Dear Reader, I am working on a legacy code base which not only is quite challenging but troublesome as well, sometimes shit, sometimes pleasant, all in all its a roller coaster ride for me. So lately i picked up a task of implementing a feature where in had to provide a functionality of Import and… Continue reading Better if feature wise subclassing

C# · Dotnet · General

Word power – Mishap when failed to notice

Dear Reader, This is about the incident i faced with one of my colleague today wherein a word which was not noticed properly impacted in judging me completely different. Normally I read technical books (Mostly C#, Unit testing, Refactoring, Design patterns, etc.) while i travel to office in the bus. As usual today i started… Continue reading Word power – Mishap when failed to notice

C# · Dotnet

Refactoring: Enums with ExtensionMethods

Dear Reader, Today i had to do some unit testing of a class which had some private instance and static methods along with non privates in it. These methods had some good core logic in it which i determined to do unit testing. Though many articles and experts say that its ok not to do… Continue reading Refactoring: Enums with ExtensionMethods