Skip to content

Tag Archives: lambda-expressions

A parameter by any other name (best practices with lambda expressions)

17-Jun-10

Lambda expressions are powerful tools that allow you to create succinct inline functions. However, without proper care they can quickly descend into an unreadable mess. While there are several ways that a lambda expression can become messy, this article will only address the naming conventions used for the expression’s parameters. Here are the two different [...]

You don’t always need a lambda expression

01-Nov-09

C# 3 gave us the lambda expression and ever since we have been using them to create abstract representations of terse, anonymous functions. While expressive and helpful, they are not always needed. Consider this example: using System; using System.Collections.Generic; class Example { static void Main() { new List<Int32> { 1, 2, 3 } .ForEach(i => [...]