As soon as I started learning Ruby, a few years ago, I got immediately hooked on its Range class. I could not believe I had been programming in .NET without them for so long. I like to think of range objects as the specification for a for loop, packaged in an object that can be passed around. That's...
Language Envy: This post is part of a series where I wish C# had a particular feature I came to like when working with other programming languages. Every time I have to produce a string in C# the little groaning chimp that lives inside my head pulls his hair out. It's about time we had a better way...
Language Envy: This post is part of a series where I wish C# had a particular feature I came to like when working with other programming languages. It's easy to let a small language feature go unnoticed. The more I spend time writing JavaScript and Ruby, the more one little detail shows itself loud...
Although C# is the language that I can call myself proficient enough to make a living these days, there are other languages that I have to use for specific tasks (like JavaScript, SQL, XSLT.) I also like using other general purpose languages for pure exploration or pet projects. I'd include Ruby...
My previous posts in this series revolved around using lambdas to encapsulate logic. In this post I'll show a different side of the lambdas, the expressions. Lambda Expressions We have already seen that lambdas can be used to create anonymous methods to be passed wherever a delegate is expected....
In the previous two installments of the series we discussed how we can use lambdas to encapsulate more processing logic and to create contextual APIs . In this post I will show another example of the latter. Navigating directory structures This time around we will try to create a safe way to browse and...
In my last post I went through a very simple example of applying lambdas to achieve more DRY . In this installment I'll cheat a little and rehash a previous article I wrote before this blog existed. The article fits rather nicely in this series. Creating XML with .Net In .Net two of the most popular...
When our programming language of choice gets a new feature, it's usually not that hard to start using that feature right away from a consumer's point of view. I could use the introduction of generics in .Net 2.0 as an example. When I wrote my first C# 2.0 piece of code, it already made use of...