2 ms·
> Functional programming, even when not in, strictly speaking, functional programming languages (MLs, Haskell, lisps, Erlang), has worked How do you know? By "
by pron 11y ago
> Functional programming, even when not in, strictly speaking, functional programming languages (MLs, Haskell, lisps, Erlang), has worked
How do you know? By "worked" the author means "has unambiguously turned out to be a good idea with very significant benefits". That some people really like something and are able to write good, working programs with it doesn't mean it's "worked" in the sense discussed.
First, each of these languages is "functional" in a very different way, so much so that even their inclusion in the same category is tenuous. Second, none of these (except maybe Erlang) has been used extensively enough in large-scale projects to give us a definitive answer regarding the actual benefits.
That functional concepts are finding their way into the mainstream is very true, but some of these have also been associated with OO for a very long time now (in fact, they've been a part of OO longer than three of the four FP languages you list have existed). Smalltalk, the most OO of OO languages, had anonymous functions from the beginning, and would tell you that anonymous functions are just as much OO as functional. TCO is not very mainstream, and as Guy Steele demonstrated, is just as relevant for OO as it is for functional. Also, adoption of some concepts doesn't mean FP as a paradigm has worked (the bigger problem is that FP doesn't even have a definition; it is continuously redefined to mean whatever it is people associate with languages that call themselves FP).
In short, we're not sure quite yet, hence "maybe".
- markatkinson 11y agoI agree with you that from the perspective of the article Functional Programming is still a "maybe" as it doesn't have the same sort of following or use in large-scale projects as OO, but I suppose it might be the perspective of the article that is incorrect. Whatsapp has demonstrated the power of FP with Erlang, and other programming languages like Elixir are starting to gain traction as they improve on the older Frameworks and make development more "comfortable". Whether they will get enough traction and garner enough of a following to become a "Yes" from this articles perspective is difficult to say but I am confident people will see the light of FP sooner than they think, and I feel like it won't be long till FP is the new cool kid on the block, I'm just not sure who will be responsible for leading that.
- pron 11y ago> Whatsapp has demonstrated the power of FP with Erlang Whatsapp demonstrated the power of actors and lightweight threads with Erlang. FP had little to do with that.
- markatkinson 11y agoGood point... I suppose that is also what Elixir is bringing to the party.
- discreteevent 11y ago"Is Erlang object oriented? Joe Armstrong: Smalltalk got a lot of the things right. So if your question is about what I think about object oriented programming, I sort of changed my mind over that. I wrote a an article, a blog thing, years ago - Why object oriented programming is silly. I mainly wanted to provoke people with it. They had a quite interesting response to that and I managed to annoy a lot of people, which was part of the intention actually. I started wondering about what object oriented programming was and I thought Erlang wasn't object oriented, it was a functional programming language. Then, my thesis supervisor said "But you're wrong, Erlang is extremely object oriented". He said object oriented languages aren't object oriented. I might think, though I'm not quite sure if I believe this or not, but Erlang might be the only object oriented language because the 3 tenets of object oriented programming are that it's based on message passing, that you have isolation between objects and have polymorphism. Alan Kay himself wrote this famous thing and said "The notion of object oriented programming is completely misunderstood. It's not about objects and classes, it's all about messages". He wrote that and he said that the initial reaction to object oriented programming was to overemphasize the classes and methods and under emphasize the messages and if we talk much more about messages then it would be a lot nicer. The original Smalltalk was always talking about objects and you sent messages to them and they responded by sending messages back. But you don't really do that and you don't really have isolation which is one of the problems. Dan Ingalls said yesterday (I thought it was very nice) about messaging that once you got messaging, you don't have to care where the message came from. You don't really have to care, the runtime system has to organize the delivery of the message, we don't have to care about how it's processed. It sort of decouples the sender and the receiver in this kind of mutual way. That's why I love messaging. The 3 things that object oriented programming has it's messaging, which is possibly the most important thing. The next thing is isolation and that's what I talked about earlier, that my program shouldn't crash your program, if the 2 things are isolated, then any mistakes I make in my program will not crash your program. This is certainly not true with Java. You cannot take 2 Java applications, bung them in the JVM and one of them still halts the machine and the other one will halt as well. You can crash somebody else's application, so they are not isolated. The third thing you want is polymorphism. Polymorphism is especially regarding messaging, that's just there for the programmer's convenience. It's very nice to have for all objects or all processes or whatever you call them, to have a printMe method - "Go print yourself" and then they print themselves. That's because the programmers, if they all got different names, the programmer is never going to remember this, so it's a polymorphism. It just means "OK, all objects have a printMe method. All objects have a what's your size method or introspection method." Erlang has got all these things. It's got isolation, it's got polymorphism and it's got pure messaging. From that point of view, we might say it's the only object oriented language and perhaps I was a bit premature in saying that object oriented languages are about. You can try it and see it for yourself." http://www.infoq.com/interviews/johnson-armstrong-oop http://www.infoq.com/interviews/johnson-armstrong-oop
- kriro 11y agoI'm in the "yes" camp for FP. At the very least it is accepted as a good thing to add to non FP languages these days (Java8) which is a good enough indicator for me. While not strictly FP, FP ideas have influenced some major successes like say MapReduce.
- pron 11y agoWhat Java added has been part of OOP for 30 years, since before ML (well, around the same time) and Haskell were even invented (let alone Erlang). So I'd put "anonymous functions" in the yes column, but not sure about FP yet.
- fenollp 11y agoErlang is 29 years old
- pron 11y agoHappy birthday! I was being approximate, though, and it turns out that my approximation was way off. Anonymous functions have been part of OO for 43 years, so still long before Erlang (and Haskell).
- kriro 11y agoMy point is that since it was finally added to the most "mainstreamy" non-functional language there is there's some mainstream acceptance. It's not my POV but an interesting data point.