.Net

Null Object Pattern

Almost every method that we write, irrespective of the programming language, we always have checks like the following one: [crayon-5c11f11a860f1371766840/] We end up adding so many null checks in our methods, that it gets almost hard to figure out what we are supposed to do in our method. This makes our Read more…

By Gaurav Gahlot, ago
.Net

Anonymous Types in C#

Generally, for an object to encapsulate some properties, the type of the object has to be defined first. On the contrary, anonymous types provide a convenient way for an object to encapsulate readonly properties without explicitly defining the type first. The type of each property is deduced by the compiler. Read more…

By Gaurav Gahlot, ago
CS Fundamentals

Understanding Assemblies

Code reusability has always been one of the major concerns for software developers. You do not ever want to write a similar code for two business problems. You would rather like to write the solution once and reuse it whenever and wherever required. This requirement of code reusability gave rise to Read more…

By Gaurav Gahlot, ago
.Net

When to use “var” as a Type

Introduction It has been quite a long time since var was introduced, yet it stands debatable among .net developers. Everyone has a different understanding as and when to use var as a type. A couple of days ago I was also a part of one such discussion, and so I decided to share Read more…

By Gaurav Gahlot, ago