Hacker News new | past | comments | ask | show | jobs | submit login

I mostly agree with your critique of javascript. I do not actually agree with 7. You do have the possibility of defining any datatypes you'd ever need. You just don't have the possibility of defining literal support for them.

All your other points are right on, but i feel that most are more the result of the history and constraints of javascript than anything else.

#3 is a language problem but is also the most arguable of your points. Ruby allows monkey patches and is one of the most appreciated languages in existence today. Also viable approachs to give the power of monkey patching without the drawbacks are just being thought today. Protocols in clojure looks good but still need the appreciation of time i'd say.

#6 is stupid i agree

Every other point are more the result of the history, and most importantly of the use case of javascript: - No sane package system sucks but a package system is hard to get right in a file based browser environnement. - Browser environnement, well yes, but that's precisely what we are talking about, you can't really say it's a problem, it's the very reason we're using javascript in the first place - Lack of rich datatypes is really bad. The lack of sets, but also of propers hash maps sucks. But more generally javascript lacks a proper standard library. Something that python definitely has. But it's also definitely harder to get right in a browser environnement, when you have got to ensure support from every browser on every platform.

But anyway, thanks for a proper critique of javascript.




The lack of sets as a data type at the language level is a serious problem with JS. Most languages which implement sets as a library make some assumption about the elements: they're ordered, for example, or they all have a unique string serialization. If you want to make a set data type in JavaScript, the language doesn't give you any of those assumptions. You might end up just using linear search of unordered arrays. (This is actually very fast for small sets, but still.)

I wrote some more about this here:

http://finger-tree.blogspot.com/2010/09/sets-in-javascript.h...

And here is a library that offers sets in JS:

http://github.com/PeterScott/simplesets-nodejs

If you're using Node.js, you can get it with npm. It could be adapted to the browser pretty easily. This is what I use, and it makes my life so much easier.


>Also viable approachs to give the power of monkey patching without the drawbacks are just being thought today.

No, they're actively being used: http://msdn.microsoft.com/en-us/library/bb383977.aspx




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

Search: