5 ms·
Sooo... people don't like JS because 1) it's dynamically typed, and 2) they don't like JS? >They don't care if first class functions are sexy. It's not about
by qwertyuiop924 10y ago
Sooo... people don't like JS because 1) it's dynamically typed, and 2) they don't like JS?
>They don't care if first class functions are sexy.
It's not about being sexy (and believe me: first class functions aren't): it's about getting a very useful feature right, something many languages seem to have trouble with, despite the fact that Lisp (and ALGOL, IIRC) got it right in the 50s.
- Roboprog 10y agoAlgol (1960s) had no garbage collection (that I know of), so any "closure-like" data captured by a function/procedure reference had to still be on the call stack. Otherwise, you certainly had first class functions, just not always with any external state captured. https://en.wikipedia.org/wiki/Man_or_boy_test https://en.wikipedia.org/wiki/Man_or_boy_test I suspect TurboPascal was in the "boy" camp, in that a reference to a function (or procedure) would not have any external state bound to it.
- qwertyuiop924 10y agoAh. I don't know all that much about ALGOL. Dijkstra said it was great, but I don't trust his opinion.
- quicknir 10y agoSorry but this reply is just kind of vacuous given the link I posted. Eric Lippert gives a pretty detailed, neutral, blow by blow summary of the issues working with js at scale. And he quite specifically says that dynamic typing is not intrinsically the problem, just that dynamic typing tends to be correlated with other things that are a problem. He specifically mentions things like error handling. Did you even read the link? I think your attitude is more that nothing is really bad with js relative to other languages, more so than actually trying to understand why it draws a lot of criticism, which is what you claimed and what I tried to link to.
- Roboprog 10y agoI read it. It assumes mutable OOP. Yes, "those people" need a safe place to play so they don't hurt themselves :-) (I'm ignoring the error handling thing, as I have not done enough server side JS to have a good feel for how the Node API handles things like I/O failures) IDEs are starting to have better support for Javascript (or similar dynamic/functional languages). In the near future, the IDEs should effectively have type inference. Once you relegate (mutable) OOP to a tool of last resort, and embrace immutable value objects plus (higher order) functions as your primary methodology, you get the automated error checking and much less drivel to read through during maintenance. OTOH, I suppose this means the dynamic/FP languages will remain a productivity lever for motivated "experts" only, sadly. At least until there is enough butt-kicking in the market that Java (and its ilk) will be displaced as was COBOL before it. COBOL was "safe" and fast, but we finally reached a tipping point were it was too painfully obvious that it simply wasted too much time writing and reading it.