Short preface: at a job interview, Zach Cox was told to aggregate words and word counts from a bunch of files into two files, sorted alphabetically and by word count respectively, which he did in Ruby and Scala. This led Lau Bjørn Jensen to do the same thing in Clojure, which apparantly sparked other people to do it in Java, Python etc.

Inspired by the afore mentioned problem, and an extended train ride home (thank you, Danish National Railways!!), I decided to see what a C# (v. 3) version could look like:

Weighing in at 36 lines and executing in 10.2 seconds (on my Intel Core 2 laptop with 4 GB RAM), I think this is a pretty clear and performant alternative to the other languages mentioned.

2 thoughts on “C# vs. Clojure vs. Ruby & Scala

  • 9. January 2010 at 15:51
    Permalink

    Smukt!

  • 3. February 2010 at 11:29
    Permalink

    The linq code looks very interesting to a non Microsofter…

Comments are closed.