Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Functional Programming was, for a long time, talked about as yet-another-solution to solve the issue of complexity in larger codebases, primarily the complexity of controlling state getting out o hand.

Similar to OOP, which promised to do this by encapsulating state, FP promised to do this via purity, aka. getting rid of as much state as possible, and only allowing stateful transition at certain well defined sections of the program.

The "market advantage" of OOP was that, via Java, it was already so well established, and so many coders had been trained in OOP languages, that it remained alive. FP on the other hand, coming out of academia and requiring all these industry people to suddenly do things in syntactically and conceptually different ways, never really gained traction. OOP simply came first, it is as simple as that.

Whether FP would have actually solved the problem is anyones guess, since it never gained the traction of OOP and Procedural languages. My best guess is that it wouldn't, because I don't believe in silver bullets.

It should be noted that both approaches contributed valueable things to contemporary languages. E.g. first order functions being the norm comes from FP.



> OOP simply came first

Not really. Lisp is a functional programming language and has existed since at least 1960. Some claim there were many other proto-functional languages since the early 60's, and the FP language [1] (a clearly functional programming language and the result of the famous paper "Can Programming Be Liberated From the von Neumann Style?") appeared in 1977 - was inspired by much earlier efforts like APL.

OOP really only became a thing with Simula in 1967, but was not popular until the 1980's with Smalltalk and Common Lisp's Object System (CLOS) came about (so yes, there was a OOP/FP hybrid already decades ago), and then C++ and finally Java much later... at which time Functional Programming languages already included Miranda (1985) which later evolved into Haskell, and Erlang (1986). That is, FPP languages were at least as common as OOP languages by the 80's.

As far as I know, however, pure functional languages were not really very efficient until Haskell came about, while OOP languages were nearly on par with procedural style: which mattered a lot in 1980's machines.

[1] https://en.wikipedia.org/wiki/FP_(programming_language)


Lisp is not a FP. It's a "List processing language" with some features based on Lambda calculus.

Real FP means referential transparency and that started with languages like Miranda and later Haskell.

What many people consider "FP" today is in fact just procedural programming with higher order procedures and lexical closure.


Lisp is even not a language, it's a family of languages. It started as a "LISt Processor", but it

A lot of early FP teaching was done in Lisp. Some kind of "Pure Lisp" was used, which are imaginary subsets of Lisp, restricted to side-effect-free, non-destructive functions.

FP started quite a bit before Miranda.


> Not really.

*sight*

Okay, let's dot the i's and cross the t's then, shall we, and include languages used long long before software development became the industry behemoth it is today.

You're right. There, I said it. You are absolutely right.

Many of the concepts of functional programming were indeed pioneered in LISP, and it was indeed specified in 1960, 7 years before Simula.

But hey, let's dot another "i" and correct my statement. Because, FP isn't in contrast to OOP so much as it is in contrast to imperative programming, and all it's mutable state, right?

So, is there an imperative programming language, older than LISP, and still in use today? And the answer is: Of course there is ;-)

https://en.wikipedia.org/wiki/Fortran


This was not a pedantic comment. Saying OOP is more popular because it just came first is a complete misunderstanding of history. In fact, Lisp was much more popular than any OOP language for a long time, OOP only took the world by storm with C++ and Java, much, much later.


> Saying OOP is more popular because it just came first is a complete misunderstanding of history.

No it isn't, because the history relevant for this question doesn't begin at the very start of programming. Most programmers active today didn't go to university in the 60s. In the timeframe relevant to answer this question, the people were indeed confronted with OOP languages, and FP languages were already a niche topic, end of story.

This also coincides with programming, as an activity, massively gaining in popularity across many industries.


There's a difference between saying "for most active developers, they learned OOP first" and "OOP came first"


I'm going to guess that most programmers active today didn't go to university in the 1980s, either (that would mean they were born in the 1960s, which would put put their current age somewhere in their 60s). So there's no point in ignoring the 60s and starting history during the 1980s when most programmers didn't start programming until later decades.


Lisp is not a functional programming language.


People are now trying to redefine what functional programming means. Lisp is as close to the lambda calculus as you can get, and Functional Programming is based on lambda calculus mode of computation (VS Von Neumann procedural model).

When you write Lisp, you're mostly composing functions. It's truly very functional, just not purely functional which is probably the motivation behind your refusal to include Lisp in the functional programming language family, which would horrify the founders of the field as it's a simple attempt at redefining a widely used, well understood term to become a small subset of it for reasons of gatekeeping what we should, according to you, include under the term without any real technical reason behind it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: