2012-12-21

Language complexity: C++, Ruby, CoffeeScript and JavaScript

Alex Corban has written an article on C++ Rocks that diagrams the complexity of three programming languages: C++, Ruby and CoffeeScript. Here is the bird’s eye view:

One way of paraphrasing “the complexity of a programming language” is “how difficult is it to learn the language until you are productive”. Obviously, measuring complexity in the above manner is interesting, but not the whole picture: Some concepts are more powerful than others. And sometimes adding a new concept decreases the complexity of a language, without making other concepts completely obsolete. As an example, look at ECMAScript 6 classes [1]. They will simplify inheritance, but you still need basic knowledge of constructors. Furthermore, much complexity is contained in software stacks (runtime library, 3rd party libraries, etc.).

The complexities of JavaScript and CoffeeScript are not too far apart. After all, the latter is based on the former. That made me think: JavaScript plus quirks is less to learn than many other languages that have fewer quirks. Additionally, when learning JavaScript, you can start small and software stacks are usually comparatively lightweight.

Reference:

  1. ECMAScript.next: classes

No comments: