Tuesday, March 23, 2010

Why I write this stuff

I just got a comment on my post Currying in C# with Oliver Sturm:

Re-implementing something that has been around for decades is hardly interesting. It's just syntactic sugar. I know that some people are eager to put this on their CV so they will probably re-write their entire codebase, using this and other such C# 3.0/4.0 constructs, which is sad really. Using currying for anything other than the simplest examples is wrong, as we have things called methods which are much cleaner, clearer and understandable:
int Add(int x, int y)
return x+y;

So I started to write a reply, but sometimes comments are too good an opportunity for making a point, so I’ve promoted the comment and my reply to a full post.

The original post was something I wrote after attending a talk by Oliver Sturm. It was one of those ‘light bulb’ moments for me and I’m still trying to work out the implications of Oliver’s talk two years later. Currying is a pretty easy concept to understand, the harder part is getting why it’s useful and how you can use it.

So why would we create a curried version of a function? The point is that you can partially apply curried functions. It's a very powerful technique somewhat like a functional version of dependency injection. I tried to explain my understanding of this in my post Thought Experiment: The Curry Facility.

So now for my rant.

This has nothing to do with CVs. It has nothing to do with showing off or trying to get a better paid job. Believe me, over ten years of working as a contractor and going to interviews several times a year has taught me that nobody cares about this stuff. Certainly no corporate project manager who’s looking for a C# developer. In fact it’s likely to scare people off. If you want an effective CV, just stuff it full of the latest drag-and-drop visual tools from Microsoft. If you simply care about squeezing the most cash from your clients, learn how to configure Sharepoint or Microsoft CRM. Wear a suit, learn how to make excuses, exaggerate and sell sell sell.

Nope, this is about the love of programming. I’m not a particularly good programmer, but I do get a huge amount of intellectual satisfaction from it. I started this blog because I wanted to share my enthusiasm and express the joy I get from playing with this stuff. I don’t really care if it’s useful (although I think most of it is) and I don’t really care whether people read it or like it (although it’s very satisfying when they do). Functional programming is awesome and if you don’t agree with me, you’ve come to wrong the place.


Unknown said...

I'm not sure which would be worse, the suit or "developing" for Sharepoint. I appreciate your blog, its good to see what can be done with Windsor because outside of playtime I don't get much exposure to it. I wasn't so into currying in particular (I have to wonder how often its useful, if the extra abstraction is necessary) but there were a lot of good Windsor IoC tricks overall.

People who are bothered by what other people blog about are going to have a miserable future, sorry to the chap who was bent by the currying writeup.

Glenn said...

Nice post, Mike. Well said.

@Frank I'd rather wear a suit with inward-facing spikes than "develop" for Sharepoint.

Damian Powell said...

Well said, Mike.

For what it's worth, I've been following your blog for some time as it seems we have overlapping interests, which currently includes functional programming from an OO programmer's perspective. I can't say that learning any functional language (whether it's F#, Haskell, Erlang, or anything else) is going to be directly useful in my day job, but it certainly has helped me think about problems in a different way and that surely can't be a bad thing, can it?

Mike Hadlow said...

Frank, Glenn, Damian, thanks guys :)