| Enough with the "JavaScript is a functional language" myth, please. Merely having first-class functions does not make a language a functional programming language. JavaScript does not promote the use of pure functions, referential transparency, and the minimization of state. JavaScript does not encourage the use of recursion. JavaScript has an atrociously broken type system, rather than a robust and theoretically sound one. JavaScript does not offer pattern matching and other functionality offered by modern functional languages. In fact, JavaScript goes out of its way to promote a very imperative, non-functional style of software development, even when efforts are made to try to use it in a functional way. And JavaScript's prototype-based OO is anything but powerful. In practice, it's nearly useless. That's why we see so many JavaScript developers try to fake a class-like OO system using it, since class-based OO does offer what they need and want. But due to the incapability of JavaScript's prototype-based approach, these hacks end up being incompatible maintenance headaches. JavaScript does not have a "powerful core". It has a rotten core, just like PHP, and it has evolved in a broken manner, just like PHP. |
It's certainly not accurate to categorize JS as a functional language, but it is flexible enough that one can program in a more or less functional style; and unlike PHP, it always has been.
Also, I've read several of your anti-JS diatribes, and I feel compelled to ask this: What drives you to denigrate JavaScript, and programmers who willingly choose to use it, wherever you can? Do you feel the need to show your superiority by bashing the languages that many programmers use to produce useful applications despite their lack of expertise? Can we not accept that all mainstream languages have warts, and that in many cases, practicality may dictate that we use a language that doesn't please us aesthetically but is nevertheless useful?