8 ms·
>I don't have any idea what you're talking about when you say 'functional came before OO'. Lambda calculus is technically the first functional language, and pr
by qwertyuiop924 10y ago
>I don't have any idea what you're talking about when you say 'functional came before OO'.
Lambda calculus is technically the first functional language, and predates computers. But if we're talking about actual programming languages, SASL, one of the earliest functional languages actually implemented, was released the same year as Smalltalk, and was influenced by the older ISWIM, which was never implemented.
>I'm guessing you are talking about Lisp, but not only are Common Lisp (and the languages it evolved from) not at all functional in any technical sense of the word.
The functional style (writing most of your code as pure functions, keeping impure code isolated), however, can be practiced in ANY language. It makes your systems easier to reason about, because you know if state is being modified. And Lisps had many constructs that made FP convenient. Like map. So while Lisp, on the whole, wasn't functional, it was one of the easiest languages to write functional code in for some time.
>On top of all of the above points, nobody in the world other than a few extreme language-philes ever use any of the functional languages, and for good reason.
On the contrary, FP has heavy use in finance and other places where there is a low tolerance for error, as well as Microsoft and many other conpanies. It has heavy use in programming language research, and a functional programming language was used for program analysis to aid in the optimization of FFTW, which is still one of the fastest implementations of the Fast Fourier Transform.
>Stop talking nonsense.
As the above demonstrates, you're the only one who's doing that.
- abecedarius 10y agoThe lambda calculus was also the first OO language. (William Cook pointed this out in http://web.engr.oregonstate.edu/~walkiner/teaching/cs583-sp16/papers/Cook-DataAbstraction.pdf http://web.engr.oregonstate.edu/~walkiner/teaching/cs583-sp1... and I'd noticed the same thing. I just want to bring in a neat observation here, not fight for either side of the OO/FP culture war. I wish we humans wouldn't do that.)
- qwertyuiop924 10y agoHeh. Neat.
- justin_vanw 10y agoHow is 'the same year as smalltalk' predating it? Simula was working in like '67, which is like 5 years before smalltalk. My point is that functional languages do not predate OO languages, and if anything come later, and you never really addressed that.
- qwertyuiop924 10y ago>How is 'the same year as smalltalk' predating it? That's just the first one that was implemented. The IDEAS reach far further back. ISWIM was '66, it it's not the oldest. >My point is that functional languages do not predate OO languages, and if anything come later, and you never really addressed that. Between my points on Lisp, ISWIM, Lambda Calculus, and others, I think I did that quite adequately.
- justin_vanw 10y agoNot really? The claim that functional programming predates OO would require that functional programming languages existed before OO languages, which is clearly false. If anything they were both developed at approximately the exact same time, which has more to do with hardware coming into existence and wider use that could support higher level languages.
- qwertyuiop924 10y agoISWIM did exist, even if the compiler wasn't there. The lisp community did a lot of work with FP-style code, even if the language as a whole wasn't functional: the idea was still there. But your main point was that FP was useless, deriding it, and claiming that, "only people that talk about it are academics and people who want to seem smart," which is demonstrably not true. Even Smalltalk had map, filter, etc, and HOFs.
- justin_vanw 10y agomap, filter, etc are not 'functional'. 'functional' doesn't mean 'functions'. It is all about side effects, and that the procedures in the language are like mathematical functions: without state or side effects. Using your definition, virtually every language in use today is 'functional', all the way down to Fortran 77, since really any language you can get a pointer or other handle to a function or callable object would let you implement map, filter, etc. Really the existence of map, filter, etc are not a clue to a language being 'functional'. Yes, you would need such things, but they are not sufficient. C is not a 'functional language', even though technically you can write C that is completely functional in style. In fact, almost any modern language can be used in a 100% functional style, avoiding side effects and state completely. Nobody does this. Even if it is one of your favorite things, virtually no one uses functional languages. This isn't because people are dumb, it's because functional languages are cumbersome and inefficient.