The World’s Best Programming Language

The world’s best programming language is Ruby. What this really means is that I like Ruby more than any other language I have tried so far. I have tried: BASIC (VBScript, Access, VBA, VB 3 – .NET 1.1, Pick, etc..), C, COBOL, Fortran, Pascal, JavaScript, Java, C#, Lisp, Prolog, and Oberon.

Obviously my world-view is limited because there are many other excellent languages such as C++, Perl, SmallTalk, Eiffel, Scheme, D, Linden Script, and many others.

Why is a JavaScript promoter saying that Ruby is the best language? I just didn’t want you to think that because I like JavaScript so much that I thought that it was the best language in the world. Actually, JavaScript is just one excellent language that was, at one time, inappropriately disrespected. It is an excellent language that deserves to be treated well among professionals. And I still like it better than C#.

Why do I think that Ruby is better than JavaScript? Mostly because it expresses objects more respectably and it has a cleaner syntax that works in an obvious way to me as developer. This makes the code very readable and easy to use. I am biased toward a dynamic-only language because I believe that it is more natural. In nature we usually learn types by the objects we see. If we see ten ducks then when we see the 11th duck we consider its features and call it a duck. We don’t reflect on its nametag before deciding what to call it. Only compilers do silly things like that.

One of the things that troubles me about JavaScript is that its future seems confusing. It appears to me that JavaScript will be getting new features that make it more like C# and C# will be getting new features to make it more like JavaScript. It is my opinion that C# will become more popular because it will be seen as “higher-level” and capable of doing what JavaScript can do. If JavaScript were to remain dynamic only, perhaps it would be in a better position to point out the unnatural part of C#. We’ll see what happens with that, but in the end, I think that Ruby will win.

Nevertheless, JavaScript can still be used dynamically and it is very good at it. For this reason, JavaScript is probably the best choice for development in the very immediate future. From JavaScript, you will probably be able to convert to and from another language like Ruby.

I changed my mind recently about the most popular language of the future. I had initially thought that JavaScript would eventually become the new international programming language, but I really am not sure now. Here’s what is shaping my current view:

  1. JavaScript’s “class” public membership is set to be static by default. This means that a new class cannot be expected to accept a property name by merely using it. This feels like a removal of something important because my C# buddies may end up making untestable code with this “feature.”
  2. Silverlight and the plug-in RIA wars. This caught me by surprise. I didn’t expect Ruby to have a chance at the client. This may make ARAX become more popular than AJAX because you can actually write client-based applications in Silverlight with Ruby in the near future if everything goes well. Plug-ins re-introduce client-based application state to the world; more on this later.
  3. JavaScript’s dynamic objects using the “prototype” method put the “guts” of the object on the outside. It’s awkward to write your object definition and then use a prototype object to implement inheritance. If you attempt to use a prototypal method as suggested by Douglas Crockford, you end up loosing the object “name” (I might be doing it wrong, but I think I’m right on that). If you jump to using classes in JS2 you loose some of your dynamics by default.
  4. Ruby’s syntax is really expressive compared to JavaScript. It’s way of handling closures seems so clear compared to JavaScript. Also the coding conventions for using “@” and “@@” signs for scoping variables makes the code naturally consistent between developers. I could go on and on with all of the simplifying syntactical choices that were made to make Ruby expressive.

So what’s this thing about “client-based application state?” It’s is the concept of client-based application state that makes Ajax so popular. During and after the browser wars of the late 90’s, the Web developers moved to the server to develop their web applications. It was the only place where you could develop a web application that actually could be consumed by everyone. It was actually harder to develop applications on the server because servers always wanted to forget you. Every time you went to the server you had to announce who you were and why you were there, even if you had just been there a millisecond ago. Elaborate state systems were developed, but the server still seemed to want to be state-less. Administrator’s wanted to “load-balance” you and do all kinds of cruel things to you as a Web developer in the name of “performance” and “security.”

As a developer, it feels more natural for the application state to be maintained on the client computer; the one owned by and closest to the client. The client seems to expect this and actually becomes your buddy when you do this. As soon as you add a little Ajax to your web application, it starts to cause you, as a developer, to challenge the use of server-side application state. So, the client computer welcomes the application state and the server seems relieved to not do it for you anymore.

What does this have to do with JavaScript and Ruby? Well, the new frontier is this client space. Silverlight came out of the gate with a bang and is planning to add four new languages to the web client: C#, Python, VB, and, you guessed it, Ruby (really, even COBOL .net should work). I honestly believe that Ruby is meant for this space.

I think it’s ironic that Microsoft is cooking up this tasty combination. The Rails community seems to be anti-Microsoft, but Microsoft has done a great thing here. Ruby on the client with Silverlight will probably make JavaScript loose some of its luster. I don’t think that Rails looks that good anymore.

I was assuming when you see the title of this article that you knew that this is my opinion only. Unfortunately, I can’t tell you, for a fact, what the word’s best programming language is because I am only one guy, but I do have some experience and I really like Ruby and I bet you would too.