What is the point of functional programming?

what is the point of functional programming?
i could do the same things 10x easier and simpler.

Attached: flat,550x550,075,f.u1.jpg (550x416, 20K)

there is no "point"

To feel what could've been

The point is feeling intellectually superior to others because you wrote it in a dense and indecipherable way.

The great thing about functional programming is not using it, but showing everyone online that you're using it.

Is usefull in very specific domains and if your knowledge about it is vast enough to not lose time trying to understand it.
So basically never

It can theoretically generate really fast programs because of no side effects and are easier to parallelize

> Theoretically

To the trash it goes.

FP is a decent technique for programming massively parallel systems. FP languages are intended to facilitate the writing of good FP code, though you can apply the same principles to other languages (for instance, tail recursive functions in C can be compiled to traditional looos).

It is an attempt to reduce software complexity, that's the point. It's just not a good one, which is why it failed. Back in the 80's it was still really popular, and Lisp even became the 3rd most used lang at one point. It fell out of use though, because other paradigms (especially OOP) just proved to be superior at allowing software to grow whilst keeping complexity down. Today, the only fairly successful FP lang is JavaScript, and it isn't even pure functional.

Attached: 1523366112141.jpg (1450x975, 523K)

It's pretty nice when your codebase grows. I like how the fp community has a strong focus on categorizing and creating common abstractions such as functors and monads.
Sure these concepts can seem daunting, but the good thing is that you only need to learn them once, thus it's not an annyoing codebase specific abstraction, it's something universal

Just because it hasn't decisively beaten C++ yet doesn't make it trash.

There's 2 major programming paradigms:

One is where you very deliberately tell the computer what to do, and combine these simple instructions into complicated software. This is of the belief that you want as much control as possible.

The other is where you tell the computer to do one thing, and the computer figures out how. This is of the belief that it's redundant and unnecessary to tell the computer each individual step, and that that's best left to the computer.

They're both very valid in their own way. Haskell is of the second variety.

I love haskell for doing the second approach. An ideal language for me is one that will give you absolutely no hints on how a processor actually works.

>i could do the same things 10x easier and simpler.

You know how I know you've never taken a commercially deployed OO backend and rewritten it in a functional language?

Functional programming is great because when you reply I will already have a very well thought out and compelling argument

No, you couldn't. Many tasks are made simpler and easier with functional programming.

The core idea of functional programming is that a function always returns the same result when given the same arguments.
Programming languages that aren't functional often rely on changing things outside of the function, like the values of variables. These things are called state, and modifying state is a side effect.
Where the difference between these approaches becomes clear is when it's time to test your application. With an imperative program, where functions modify and use the state of something, you'll have to test for every possible permutation of the state to be sure that nothing can go wrong. With a functional program, you can test every function on its own because there's a guarantee that a function doesn't do anything weird because the program state is odd.
A stateless program is simply easier to test, and also easier to reason about. You can apply maths to a functional program to prove that it's correct, in the same way that you can prove the Pythagorean theorem.

OOP didn't prove to be superior, but the idea that programmers were interchangeable machines did. The exponentially growing need for programmers necessitated that all trained programmers should have exactly the same skillset and the same methods for problem solving, which gave rise to "industry best practises" and design patterns, and to languages you can get official certification for, like Java. Lisp was phased out primarily because it let the programmers think too much, coupling authors to their code, and making it more difficult to replace or bring in new professionals to work on the code.
Even if the code and the languages were inferior.

fmap (based . absolutely) . ifToMaybe isJokeAboutPointfree

with your >pic related you can write algorithms very generic and (in any imperative language) retardedly inefficient, but in practice be as fast as a C implementation. Except you were done in 5 lines of Haskell.

Many languages still enable functional programming anyways

>Using map and lambdas is functional programming now.

>"functional programming may have been too smart to win"
>tfw to intelligent

Attached: 843.jpg (640x640, 57K)

I was just talking about recursive constant functions. C and c++ compilers optimize tail recursion for example too. You can do functional programming but it's far from the only way

The world doesn't believe it needs smart people. It believes it needs lots and lots of monkeys sitting at typewriters.
How do you suppose the software world got to the point where it is now? Not by writing Lisp.

>Recursive functions are all that is needed to count as FP.
Please, stop embarrassing yourself.

> (((lisp)))
yikes

Attached: B2ABC6C8-8632-4114-A926-73697E804400.png (480x271, 26K)