Declarative state of mind

Over the years, we have seen C# language evolve into a more dynamic language, and also have seen numerous frameworks and APIs out there implementing a more declarative style. Famous example would be LINQ, and one can appreciate how the language flows and how readable it is. For too many years we have programmed in a procedural manner, and we have forgotten who the target audience for our code is…..yes the audience is us, the programmers!!!!

Procedural code can be hard to read, which makes code hard to maintain. To be declarative is to write code in a way that declares your intention fluidly using fluent interfaces. I’ve come up with an example that illustrates this.

Read the rest of this entry »

Posted in C#. Tags: . Leave a Comment »