Re JavaScript, I'm referring to the lowlevel nature of many of its constructs:
- its impoverished way to pass parameters (i.e. there are no keyword parameters; you don't get an error if you pass too many or too few arguments)
- its impoverished exception handling (i.e. you can't catch exceptions of a specified type)
- its impoverished standard library and built-in data structures
- its lowlevel and complicated OOP system
There's more, see http://pwpwp.blogspot.com/2009/08/awesome-helma-and-lacking-...
Re Python and Ruby, I'm mostly referring to the fact that both languages started out with broken lexical scoping, and had to change their scoping rules repeatedly, which is a huge red warning sign. Additionally, it seems very hard to implement both languages so that they run fast, another factor. Ruby also has an array of different kinds of first-class functions (blocks, procs, lambdas, I lost track), with different capabilities and restrictions, which is a design failure to me. That said, I think they're acceptable languages, even if they force you to memorize a lot of irrelevant stuff.
- You can emulate keyword parameters by passing an 'options' dict, and you can emulate defaults by 'var myOpt = options.myOpt || default". You can also define a function, like $.extend, to do this for you.
- You can catch exceptions of a specified type by checking the type and rethrowing if it's not appropriate. And you can define a function to do this for you:
function try_catch_if(exc_type, body, exc_handler) {
try {
body();
} catch (e) {
if (e instanceof exc_type) {
exc_handler();
} else {
throw e;
}
}
}
- You can define your own standard library a la JQuery or YUI, or even modify the built-in one a la Prototype (though I don't recommend this). And the built-in data structures aren't all that bad.- You can build whatever OOP system you want on top of prototypes, and many libraries do just that. (In this respect, it's quite similar to Scheme, where every programmer starts by defining his own incompatible object system).
Most of the sucky parts of JavaScript come from it introducing things that weren't really thought through, eg. the 'this' keyword nonsense is ridiculous, as is the lack of argument-checking by default.
I'm just saying this "flaw" doesn't make any sense as such. If you want to tell me that with some perspective it's a flaw, show me the perspective, because I'm not seeing it at all. It looks pretty ridiculous on my end.
However the hashtables are broken: they say they're empty, but they have 'constructor' as a key when you create them.