The author's C# example predated the release of LINQ, which makes the C# syntax much more like the Python's. The author's code:<p>string.Join("\n", mylist.ConvertAll<string>(
delegate(Foo foo)
{
return foo.Description();
}).FindAll(
delegate(string x)
{
return x != "";
}).ToArray());<p>can be rewritten as:<p>string.Join("\n", (from f in myList
where f.Description() != ""
select f.Description()).ToArray());<p>which is super-easy to read and understand. Maybe not as concise or pretty as Python or Haskell, but definitely a step in the right direction.<p>Others' comments that the author should consider F# are well founded, as it integrates seamlessly with other .NET-based code (such as C#) and is a pretty great language. However, it's worth noting that the post was written in 2006, well before F# was widely known about or distributed.
"The fact is that functional idioms work badly in languages that don't have syntactic support for them."<p>Then <i>don't use those idioms</i>. Work <i>with</i> your language, not against it. Learning Haskell taught the author to be more conscientious with state. Good. But nobody wants to debug imperative/OO code written by somebody newly infatuated with Haskell* -- it's like when people study a foreign language in high school and start dropping little fragments of Spanish/French/Japanese/etc. into casual conversation all the time, oblivious to whether the people around them understand it.<p>One of the comments (by "tom") nails it:<p><i>One of the more potent reasons for learning other modus operandi in programming to keep you from building tolerance to the same assumptions.</i><p>Learning several unrelated languages will almost certainly make you a better programmer, but code that assumes everybody else you're working with has the same background as you will be difficult to maintain. The language you're working in is the foundation for your shared culture, so do your best to write idiomatically in that.<p>* I have been guilty of this.
<i>Update: I probably should have made it more obvious for some people that the title of the post is not entirely serious, and mainly I'm just griping.</i><p>I think this explains the whole article and why there is no serious discussion here.
Comparing C# 2.0's functional capabilities to Haskell/Python is terribly misleading. You can perform functional tasks easily in 3.5 using lambda expressions and built in functional operators such as:<p>listOfTestObjects.ForEach(x => sOutputDescriptions += "\n" + x.Description());<p><a href="http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx" rel="nofollow">http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-...</a>
Actually, there are some serious points here. Consider this:<p><a href="http://www.postmodernprogramming.org/stories/fixed_point_madness" rel="nofollow">http://www.postmodernprogramming.org/stories/fixed_point_mad...</a>
The title is "Why X makes you a worse progarmmer"<p>Then his conclusion: "I have no doubt that in general I am a better programmer for learning these languages..."<p>Um, hello?
...when programming in less powerful languages, because they start to seem inadequate.<p><i>I constantly find myself wanting to use idioms from these languages, or noticing how much less code I'd be able to write if I was using one of these languages.</i>
C# was, to me, the best available language in TopCoder competitions. Once I had more than a passing acquaintance with Python, Lisp, Ruby and Haskell, it was annoying to compete in it. I spent a bunch of time trying to imagine a way to write in a language of my choice using code generation. Eventually I just gave up, and stopped playing (though this was one of many contributing factors)
Enthusiasts always put their language of choice on a pedestal. Python is a very good language, but I often find it to be too restrictive and will use Ruby/Perl for elegant metaprogramming and Erlang for functional programming.
As others have said, stop fighting the language and embrace it. For the Java haters, here's a Java one-liner that is not much longer (though I'll admit, uglier) than all the rest:<p>result = join(new ArrayList<String>(){{ addAll(list); while(remove("")); }},"\n");<p>And as a bonus - for the extra few characters you typed, this will fail at compile time instead of runtime when the list turns out to contain FooBars instead of strings.
The title is catchy but imprecise. After discovering the concision of python and haskell, the author has less tolerance for the verbosity of c#, the language with which he earns his living. Perhaps the solution is to earn a living with a more concise language.
Reminds me of a time I screwed up a Java project (well, not really; just took a long time to write code most Java devs wouldn't understand) by using attempting to use generics and Java's static typing system to build-up an ML-esque ADT system.<p>4-ply parameterized types (e.g. string array list option) do not attractive siblings in Java-land.