3 ms·
Closures + Lexical Scoping + Prototypical Inheritance makes for a pretty great language IMHO.
by zackbloom 13y ago
Closures + Lexical Scoping + Prototypical Inheritance makes for a pretty great language IMHO.
- ldh 13y agoThose things are indeed nice, but they can't defend against the other insanities that come in the box with them.
- gcr 13y agoOnly a subset of Javascript is useful, just like how only a subset of C++ is useful, just like how only a subset of Objective-C is useful, just like how only a subset of Haskell is useful, ...
- yen223 13y agoWasn't there a saying: "90% of everything is crap"?
- coldtea 13y agoAll languages have crap. C? Buffer overflows, manual memory management, header files, severely lacking standard libraries, crap support for most modern idioms, etc etc. C++? Tons of edge cases, template madness, unbelievable large language spec, etc etc. Python? Python 2 - 3 dichotomy, crappy concurrency / parallelism support, , strict on whitespace, standard libs in various stages of cruft and abandonment, no proper closures, CPU bound for lots of interesting problems necessitating bilingual development with C extensions or the use of hacks such as Cython etc. You can find a similar list for everything, from Lisp to Haskell. Javascript "insanities" are no big deal. People have been creating large apps (including porting stuff like THE WHOLE BLOODY QT TOOLKIT to it) in it with no problems. Once you know them, you can work around them. A huge install base, huge number of programmers, easy syntax, powering the internet, lispy-flexibility, and the fastest interpreters this side of the JVM are enough benefits to counter some crappy coercion rules and FP only math bizarreness.
- pi18n 13y agoI think this comment would have been better if you had listed some insanities that make Javascript unusable. It doesn't seem objective at the moment. I, for one, honestly cannot think of what you might be referring to, but I only have a passing knowledge of Javascript so I cannot really decide if you are the GP have made the better point.
- to3m 13y agoAnd the global object nonsense alone is enough to make it suck. Throw in the lack of an integer type, the curious `for each' statement, and the oddities surrounding `this', and it really starts to feel like this is the sort of language that over time is going to cause you a lot of heartache. It makes me sad - seriously, do people not expect better from their tools? The maddening thing is that Javascript could so easily be vastly better, and it wouldn't take all that much. Remove any kind of implicit binding (and this could easily be optional, like Visual BASIC's option strict, or the similar thing in perl) and you'd be about 75% of the way there, in my view. It would take a bit more to convince me that this kind of language is suitable for larger-scale projects - this based on my experience with pretty much any language that isn't statically typed - but this would at least remove one obvious type of error without impinging too much on what people appear to see as their freedoms.
- cheapsteak 13y agoI was under the impression that javascript's strict mode already does this?
- to3m 13y agoYes, it looks like it does. And browser support looks decent enough. Thanks! I don't recall seeing this mentioned anywhere. Perhaps the still-imperfect browser support puts people off.
- pornel 13y agoObjC has closures (blocks) and ObjC runtime (but not the syntax!) supports prototypical inheritance. Actually the ObjC runtime is amazingly powerful and dynamic, as if it was made for a better language (e.g. can handle dynamism of Ruby http://macruby.org/ http://macruby.org/)