4 ms·
Javascript, of all things, wasn't neatly "designed" either. The core language was hacked together in several weeks, by a few developer at Netscape. Javascript
by philipp-de 13y ago
Javascript, of all things, wasn't neatly "designed" either.
The core language was hacked together in several weeks, by a few developer at Netscape.
Javascript wasn't made for large applications.
It was made for form checking and rollover menues (some of the earliest examples back in the day) ;)
It can be argued that Javascript has many unfixable design bugs, too.
Just sayin.
- dasil003 13y agoWell that's why I said "even" Javascript. Brendan Eich actually pulled off a small miracle by embedding incredibly powerful functional and prototypal paradigms in JS. It's not perfect, and there are plenty of warts, but JS came out of the gate with a powerful core that PHP took decades to add in a Frankenstein manner.
- PommeDeTerre 13y agoEnough 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.
- MichaelGG 13y agoWhat is the nature of functional programming? HoF.
- PommeDeTerre 13y agoSupport for higher-order functions is obviously a minimal requirement of a "functional programming language". But functional programming extends far, far beyond that. It also embodies a philosophy emphasizing the purity of such functions. It encourages the use of recursion for iteration. It encourages the use of robust type systems. It encourages the use of pattern matching. It discourages the use of many imperative approaches. Although they may offer some form of higher-order functions these days, I don't consider languages like JavaScript, C#, C++, Ruby or PHP to be "functional programming languages". They're imperative languages that just happen to have added the most basic of functionality expected from functional programming languages. They don't truly encourage, and only partially enable, the writing of software using a functional approach.
- Shorel 13y agoAccording to you, is Common Lisp functional?
- PommeDeTerre 13y agoI wouldn't say so. It's far, far closer to a functional programming language than JavaScript is, for instance. But it's clearly nowhere near what Haskell or Standard ML are, either. Maybe "semi-functional" would be a good term for it and Scheme. It has some of the important elements of functional programming, but not all of them.
- dasil003 13y agoDon't set me up as straw man for your anti-JS rant. I never said JavaScript was a functional language, and I never said it was a great language. I just said it is better conceived than PHP, no more, no less.
- 13y ago