2 ms·
Also interesting in addition to the other fine replies is that Javascript qua Javascript hasn't actually moved all that much in the past 15 years, and in 2002 J
by jerf 9y ago
Also interesting in addition to the other fine replies is that Javascript qua Javascript hasn't actually moved all that much in the past 15 years, and in 2002 JS would definitely not have been a "functional language".
I'd say it's a language whose issues are sometimes something that FP is best at papering over, but as an FP language, it is quite lacking if you're used to something like Haskell, Erlang, or Lisp. I actually put it in the category of OO-FP languages, languages that have a lot of the FP constructs (especially from when Lisp was the epitome of FP) but are primarily object-oriented languages. It's a pretty decent paradigm, but it really ought to be distinguished from FP languages where there are no OO features in them at all, or much more rarely, where they are clearly second-class.
- leshow 9y agoJS had first class functions from the beginning, which I think is one of the major things necessary for FP. Compare that with a language like Java, which did not, and I think still doesn't (lambda's aren't quite the same). JS doesn't really support traditional inheritance either, so describing it as OO seems odd to me.
- jerf 9y agoI consider anything that binds data to methods and has a concept of "data.method()" to be OO. In the OO religion I'm an ecumenicist. And even within my ecumenicalism, I consider inheritance in the strictly C++/Java sense of relatively little importance, and dropping. Rather than being essential, it turns out to have been accidental, and also arguably a mistake, even on purely OO grounds.
- leshow 9y agoThat's a silly distinction. It's also wrong. Rust 'binds data to methods and has a concept of "data.method()"' and is not OO by any meaningful definition. It's simply sugar for Trait::method(&data).