C#

LINQ – Lambda Expression vs Query Expression

As you’re probably aware of already, LINQ comes in two flavours – using Lambda expressions and using SQL-like query expressions: Both yields the same result because query expressions are translated into their lambda expressions before they’re compiled. So performance-wise, there’s no difference whatsoever between the two. Which one you should use is mostly personal preference, …

LINQ – Lambda Expression vs Query Expression Read More »

The Stack, The Heap And The Memory Pitfalls

In the last couple of days or so I have spent some time reading Karl Seguin’s excellent and FREE to download ebook – Foundations of Programming which covers many topics from dependency injection to best practices for dealing with exceptions. The main topic that took my fancy was the Back to Basics: Memory section, here’s …

The Stack, The Heap And The Memory Pitfalls Read More »

Pattern for dealing with null handler for events in C#

If you’ve used events in C# before, you’ve probably written code like this too: This is perfectly ok and normal to do, but can quickly become tiresome if you have to fire events in multiple places in your code and have to do a null reference check every time! So instead, I have been using …

Pattern for dealing with null handler for events in C# Read More »

Functional programming with Linq – IEnumerable.Aggregate

As I was learning functional programming with F# I came across the List.reduce function which iterates through a list and builds up an accumulator value by running another function against each element in the list. Back to the more familiar C# territory, LINQ has introduced some functional features to C# and one of these is …

Functional programming with Linq – IEnumerable.Aggregate Read More »

Buzzword Buster – DDD

Definition: Domain Driven Design (DDD) is an approach to software design which puts the focus on the problem domain and provides a structure for making design decisions to accelerates software development for complicated domains. The key components in DDD include: Domain: the subject area to which your program is applied Model: abstractions that describe aspects …

Buzzword Buster – DDD Read More »

Throwing exceptions the right way

Use ReSharper? Notice every time ReSharper sees code like this: it complains, and tells you to get rid of the ex for the reason ‘Exception rethrow possibly intended’? The reason ReSharper is warning you about an ‘exception rethrow’ is that when you rethrow an exception it replaces the stack trace of the original exception with …

Throwing exceptions the right way Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close