Telerik JustCode is a Visual Studio extension that helps with code navigation, error checking, test runs and more. It’s still Visual Studio, but with slight improvements all over that makes the everyday coding easier. While many coders claim they can’t live without certain productivity or refactoring tools I’ve never been one of those. I’ve never… Continue reading Telerik JustCode
Category: C#
Naming by Purpose or by Effect
What’s the best way to name a css class: form-field-label or bold-text? Is there any difference between MVC’s EditorFor and TextBoxFor? Or between a DetailedRowText property and ArticleDescription? For all the cases, there is a difference. The first one is naming by purpose and the other naming by effect, or what it actually does. Even… Continue reading Naming by Purpose or by Effect
Creating an Empty List<AnonymousType>
This post is written by guest blogger Albin Sunnanbo. He’s a great friend and source of inspiration and also one of the best developers I know. It was Albin that first introduced me to LINQ, EF Migrations and jQuery that I now use daily. Sometimes you use Tuple<T1, T2> in C# to store results of… Continue reading Creating an Empty List<AnonymousType>
Merging Expression Trees to Reuse in Linq Queries
Reusing parts of LINQ queries is easily done by chaining methods returning IQueryable. Unfortunately that doesn’t cover some senarios like reusing member initialization lists. To handle such a situation I wrote a Merge extension method for select expressions. For this post we’ll load the data required for a list of cars and a detail view… Continue reading Merging Expression Trees to Reuse in Linq Queries
On Null or Why Empty Strings are not Same as Null
Null is an important, but sometimes hard concept. What’s the difference between an empty string and a null string? One of my first Stack Overflow questions was (NOT) NULL for NVARCHAR columns. Some people claim that using null is always wrong or is some kind of voodoo. If you feel the urge to use Nullable<int>… Continue reading On Null or Why Empty Strings are not Same as Null