The programming world has come a long way since Donald Knuth made his arguments for limited use of go-to statements.

People are starting to think less about execution speed and memory consumption and more about readability and conciseness. Scripting languages are being used more and more for the following reasons, among others:

  • We don’t want to compile our code – it is a superfluous step when the code can just as well be interpreted
  • We know when to use a hammer and when to use a nail gun
  • Scripting languages are becoming as powerful as “real” programming languages
  • Compilers/interpreters are better at doing the”hard work” of transforming human readable code into efficient instructions for the machine

I started learning c long ago but quickly moved up through the abstraction layers. This was in part due to the types of projects in which I was involved (not so much hardware programming) and by requirement from the programming courses I took at my school, Technical University of Denmark.

Over the years I’ve worked with languages such as VB, Java, C#, SML. When writing a compiler for the while-language (simple toy language) in Java I discovered the purpose of dynamic types and reflection and how much I’d missed them, really. Since then I’ve been looking seriously at a number of dynamic programming languages for the purpose of finding a generally adequate language for all – or at least most – of my projects. I have not yet succeeded.

Why would I want such a language? It certainly helps me as a programmer to try new languages. I get to see new aspects and approaches in my “previous” favorites. But one has to accept that every language brings a learning curve not only with respect to the kinks of the language but also the programming environment (IDE), the documentation as well as the community.

So what makes a good language for me? By now I have some pretty specific demands for a new language:

  • Minimal syntax. For example, I believe semi-colons (;) should only be mandatory for multi-line statements.
  • Lots of syntactic sugar. Some people are not happy about this. For reasons of backwards compatibility I can see why – the language should stay be stable and syntactic sugar planned ahead. Sugar reduces line count and increases readability.
  • Large standard library. Logging, database connectivity, network interaction, etc. I detest having to pull libraries into my projects for functionality, which ought to be covered by the standard installation.
  • Multiprogramming support. Hardware makers are hitting some physical limits, which impair serial execution speed. The natural answer is to add multiple CPU cores. The language must be able to exercise them in a natural way.
  • Platform independence. Windows => users, Linux => developers. Bad mix, though I can understand why it is so! Both Linux and Windows suck in their respective ways.

Ruby: a great language not just for programming web sites! Ruby is purely object oriented. Ruby, however, is not a first class citizen on Windows. Releases for Windows severely lag behind the UNIX releases and some functionality eg. fork does not work on Windows. Furthermore, Ruby does not use OS threads but rather implements green threads. All “green threads” run in a single thread, as perceived by the OS, and thus cannot be scheduled in parallel on multiple processors. Netbeans has worked great as an IDE for ruby. Gems are awesome…

Python: a google fight between python and ruby leaves python far behind. I suspect in part because of the ruby-on-rails phenomenon. However, python has been adopted by google, which indicates some things… python eliminates many lines-of-code by using indention – which every coder uses anyway to structure his program – as a natural part of the syntax. Unlike Ruby, Python is not purely OO. In fact, python has an odd mix of OO and procedural syntax. Python also has some weird (seemingly superfluous) syntax in some places, eg colon after the condition of an if. The python FAQ explains that this is so for historical reasons/you should just accept it and left me with a bad taste in my mouth.

Groovy: a fresh, new scripting environment ready to be assimilated in java environments. I really like groovy. For instance the it variable takes away many extra characters in simple mapping operations. Groovy is lacking ruby-like modules to import functionality on a global basis. It is slightly cumbersome that methods, which take no arguments, much be addressed ala myobj.method() rather than just myobj.method. I have yet to find a proper IDE for groovy! The plugin for Eclipse is horrible and cannot run certain examples, which run fine from the command line.

(Javascript: Beautiful. For writing web applications. )

To be honest I prefer working in Ruby. But the poor support for Windows and lack of native threads is a show stopper. Groovy has a pretty appealing syntax but lowly IDE support. The procedural elements and unexplained syntactic elements of python are plain annoying.

Today I find myself coding projects in C#/.NET. Hardly cross-platform and Microsoft, along with my fellow countryman Anders Hejlsberg, has made sure C# is overly verbose and the combination requires lots of “boilerplate” code…

Why do I code in C#/.NET? This combination works. Visual Studio is pretty good, .NET has good support for parallel computation, Microsoft – unlike SUN with Java (which is more-or-less frozen since 1.5) – actually add syntactic sugar with new versions and also, I find the .NET library is actually pretty good!

Have you done some surveys of current dynamic languages? Maybe you disagree with my findings or just found the “perfect” language to suit your needs? If so, please tell me!