Why should I learn a functional language?

What benefits does a functional language have that OOP languages don't?

For example, python has functional statements, and java just got lambdas in java 8.

What benefit would there be for me to learn LISP, haskell, etc?

People here seem to hype them up as being what makes you a "real l33t programmer", but I'm convinced its a meme unless you can prove me otherwise.

Other urls found in this thread:

elm-lang.org/).
twitter.com/NSFWRedditGif

dude it makes your programmer dick bigger and more upboats on /r/programming

literally the only argument I've found so far.

is there a real-world use for them? outside of hardcore-mathematics professions?

you've clearly haven't done any real programming

'lol you're not one of us, learn haskell faggot'

This argument doesn't convince me.

Don't lump Haskell in with LISP.

Haskell is a toy language that is designed purely to be elegant.

Personally, using LISP gives you an even better understanding of how to use necessary FP structures in langs like Python/C++/Java, etc

I wouldn't say it's a toy language, but more of a teaching language for a certain paradigm. There are few places where FP langs are the primary lang used, in the real world, but their concepts are very largely useful

both make you change the way you see programming. Before you learn either of them you're pretty much using a procedural language and thinking that's the way it is.
Of course, if you only care about the shekel and being a good goy, of languages that'll give you a job, and not at all about becoming a better programmer, then you can happily ignore them.
But if you do think you for some reason want to write better code, then the paradigm shifts can help you write more concise, clean code, and to show you where some approaches might be better than others
But since you mentioned java, I can guess what group you belong to

>using LISP
>LISP
>in CAPS
This is tell-tale sign you are a Lisp noob at best.

Anyway, OP, learn Elm (elm-lang.org/). It's super easy and purely functional, so you will have to think functionally to use it.

>he's a noob because he spells it the way he has been spelling it since 1958
O-okay?

Why is there a beetle on the cover

Why is there a whatever on anything of their books

Don't reply to my post ever again

Shit's going down lads

>hardcore-mathematics professions
Retard.

If you are not interested in programming language theory then don't waste your time with pure functional programming.

No, don't learn it,
it's just a meme.

t. Haskell-programmer

>What benefits does a functional language have that OOP languages don't?
None. It's a hobby category of languages not suitable for production.
>For example, python has functional statements, and java just got lambdas in java 8.
Correct. Fully functional is fully autistic. Functional are hobby languages for unemployed neckbeards.
>What benefit would there be for me to learn LISP, haskell, etc?
It's interesting from an academic, theoretical point of view, and it's a nice hobby to have.
>People here seem to hype them up as being what makes you a "real l33t programmer", but I'm convinced its a meme unless you can prove me otherwise.
You are quite right though, it is a meme of sorts, so I can't prove you wrong.

This is what people said about OOP in the early 90s

Don't reply to my post or my son's post ever again.

There's no reason not to use any functional language since they're well optimized to run like any imperative language for most of the tasks, while being much more concise and easy to grasp.

will it improve my programming skills enough to a point where i get a significant raise

>What benefit would there be for me to learn LISP, haskell, etc?
I have never come across a job that requires use of either.

Bullshit. Visual C++ for instance was first released in 1993, and Turbo C++ in 1990. Many people was already using Smalltalk since the late 70s.
Haskell design started in the late 80's, Java on the other hand in the mid 90's.
Pure FP is a meme outside of academy, period.

OOP was barely used outside of academia before Java

>he uses oop despite it being intrinsically anti-parallel and anti-modular

Not at all. OOP started being used in industry with the new graphical workstations and got really big when GUIs went mainstream, but it was still important before then.

When OOP started getting popular, academics needed to invent new techniques to describe objects because they were focused on FP. They were saying FP was the future since before OOP was mainstream.

Have you heard of the papers "The Next 700 Programming Languages," "Correspondence between ALGOL 60 and Church's Lambda-notation," and "Can Programming be Liberated from the Von Neumann Style?"

Sure thing m8, and that's why Borland made a fucking compiler and ide for it... fucking Wolf3D used it! stop spreading lies

OK here's the litmus test: can you people name any great popular usable applications written entirely in Haskell ? And if not ,why not ?

Yes. People who use Lisp and participate in online discussions about it will have their all-caps spelling corrected until they switch to writing it as "Lisp". Those who do not participate in these discussions but have at least read them notice the pattern as well. There may be nothing inherently wrong with writing "LISP" but it is nonetheless a strong sign that someone is a Lisp memer rather than a Lisp user. (Also, the latter usually recommend CL, Scheme or Clojure rather than Lisp in general. One reason is that for ages there have been flame wars as to whether Scheme and Clojure should even be called "Lisps".)

But it certainly wasn't mainstream before the mid 90s

It wasn't mainstream

The point is that OOP existed 20 years as an academic interest before it got popular

xmonad

FP have been around for almost 70 years, please stop

epic xd

So? It works well for parallelism which is growing more important. The point isn't that it takes a specific number of years for something to get popular, it's that it can exist for decades before that happens.

Can you name one such Java program?

Pandoc. Not that it's a reason to learn Haskell.
More like late '80s-early '90s.

A bunch of Google's web applications, including the search engine itself early on. Amazon. Minecraft.

>early on
>minecraft which is buggy crap

So I'm practicing functional programming, or rather, trying to program functionally (maybe I'm not doing it right?). I'd like some feedback;
1. Is this code functional in style?
2. Is there a better way to format the line returns and white space to make this more readable?
3. Is this a good solution?
/*
Flattens an array whose elements may be primitives,
arrays or multi-dimensional arrays.
concat can take either primitives or arrays, which helps
make a short solution.
*/
Array.prototype.flatten = function () {

return (
list =>
list.some(e => typeof e === 'object') ?
list.flatten() : list
)
(
this.reduce(
(p, c) => p.concat(c), []
)
);

};

var b = [0, [1], 2, [3], [4, [[5]], [6] ] ];

console.log(b.flatten()); // [0, 1, 2, 3, 4, 5, 6]

All of JetBrains products, with the exception of their Visual Studio plugin:
- IntelliJ
- CLion
- phpStorm
- PyCharm
- WebStorm
- DataGrip
- RubyMine
Oracle's SQL Developer
Backend infrastructure for essentially every major corporation in the world.

That's not one

Dumb Java dev

>great popular usable applications
>those
no

There's literally no non-Pajeet software written in Java

Let's be honest, all the Java shills here are Indians

>Pajeet software
What's your definition of this; any software that makes money? Any software that accomplishes something? Any software not related to masturbating to anime?

Neo4j is the biggest graph database, letting developers model data using graph theory. Java.
Matlab is an essential tool for doing engineering calculations. Java.
Android is objectively the best smartphone OS. Java.

The only reason people fawn over functional programming is because stupid people usually can't figure it out, so there's less bad code written in Haskell as there is in Java (or C++ or python or javascript or any other easy to learn language)

Functional programming is easier to write multi-threaded applications in. It's fantastic for big data as well.

Pretty much this.

No, stateless code is easier to write multithreaded applications in. You can write stateless code in any language, and you should, because stateless code is best code. Functional programming just forces you to do it.

>multithreading
this. traffic light software, phone switchboard software and the stock exchange software make full use of this feature.
You can also hot-swap code with functional languages, thanks to no side effects nor state. This means services won't have any downtime when being updated/patched.

...

literally every Android application