Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

First, you should take the whole post with more than a grain of salt. ;)

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.



JavaScript has a certain elegance to the minimalism, though, much like Scheme:

- 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.


You can build your own keyword-argument passing style, exception handling, standard library, and OOP system with assembly as well. Most of would rather start with a language that got these features right in the first place, rather than defending languages that didn't.


Totally agree.


Really? You're calling Python a messed up programming language because ten years ago it got lexical scoping? I don't know about Ruby, maybe it's had a rougher road, but that's really the only scoping rule change Python got. It got an additional keyword -- nonlocal -- recently to allow you to rebind variables in outer scopes, but otherwise no change has been had since then. If this is a warning sign, what on earth am I supposed to be watching out for? What's this danger it's warning me against?


You're taking this entirely too seriously. There is no such thing as a perfect language. Most flaws are features when looked at in the right light. And obviously the reverse is also true.


I never said Python was perfect. I consider it seriously flawed in many respects. I'm not defending Python as a perfect language.

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: