Explain oop vs fp to me like im a brainlet (because i am)

explain oop vs fp to me like im a brainlet (because i am)

Attached: haskell.png (225x321, 12K)

They are not mutually exclusive.
OO is far more practical.
Functional is niche.
A combo is great.
Declarative is garbage.

oop just werks, functional is cool too but no one used it for professional projects because it's a mess to maintain once the codes base grows and it's hard to get programmers that know functional languages that aren't memes

Declarative is great to make UI tho.

>oop
It's all objects
>fp
It's all (mathexmatical) functions

OOP is when you want everything to be modular, so you invent this meaningless concept called "encapsulation" and pretend it spares you reading other people's code (it doesn't). Instead of two structures being able to access each other's data, you make them send each other signals, and that's one function to write per signal.

FP is when you want so much to be unemployed that you make everything functions. You delude yourself into thinking that passing functions as parameters is impressive (C could do that in 1972) and that returning functions is the most powerful feature a programming language could offer (it's not). But since the only job you'll ever get with that is flashing some gay LEDs, you pretend that FP has a mathematical beauty in it, as if greasy faggots from Jow Forums ever sat in on a single college math class. You will also pretend that FP is more difficult, ignoring the fact that this paradigm makes you intellectually incapable of understanding what a program state is.

OOP and FP are different solutions to the same problem, the problem being mutating state in a program. Programs can be difficult to debug and reason about because it is hard to keep track of how, when and where the state of your program (variables, data structures, etc.) changes. The OOP solution is encapsulation, which means that you hide the state away and make it so you can only access or modify the state through functions. The FP solution is to not have any (or as little as possible) mutable state in the first place and make the program like a series of mathematical functions. Of the two, OOP is for sure more popular and easier to learn but tends to lead to larger and more complex programs than FP. FP is harder to learn up front and isn't necessarily viable in all languages but can lead to cleaner code. The two aren't mutually exclusive and you can use a mix both in your code.

Homos vs incels

>Declarative is garbage.

Isn't SQL declarative?

OOP = Inheritance = Absolute mess

Unironically this: in OOP your objects take objects and return objects, while in FP your functions take functions and return functions.

Also, in OOP your objects hold and mutate state, while usually in FP your functions don't "hold" states nor mutate variables: instead they just "transform" data (as in generate new data based on other data).

OOP = shitty codemonkey jobs for brainlets
FP = fucking awesome jobs for very smart people

>FP
>jobs

>OOP = shitty codemonkey jobs for brainlets
>FP = fucking awesome jobs for very smart people
More like fucking very few awesome jobs

But functional is declarative.

Declarative is good as a DSL

Isn't JS FP?

Attached: IMG_20180801_111329.jpg (1024x576, 61K)

OOP is an ad-hoc idea to organize code with objects. You associate functions with data that they operate on. Sometimes it's confusing because the functions operate on a few pieces of data so you don't know which one to assign it to. Another aspect of OOP is class hierarchy and inheritance; that is you make templates for objects and extend these templates to make more templates. It actually can make things confusing as well, imagine this scenario (inheritance + subtyping):
>make a Point class
>introduce equality operator on Points: points are equal if their coordinates are equal
>extend Point to ColouredPoint
>ColouredPoints are equal if their coordinates and colours are equal
>p1 := Point(1, 1)
>p2 := ColouredPoint(1, 1, blue)
>p3 := ColouredPoint(1, 1, red)
>p1 == p2
>p1 == p3
>p2 != p3
Essentially it's a bunch of idea mangled together that are good enough to make things werk but sometimes it gets weird.

FP is derived from solid basis of lambda calculus. Lambda calculus is a way to describe computation with anonymous functions. These functions can operate on other functions and that's where the fun in FP is: you abstract with functions. The problem is that you can't really describe side effects in lambda calculus and side effects is what you want your program to do. So FP programmers have done a lot of mental gymnastics to manage side effects. The side effect of it is that your side effects are very limited (controlled). FP has much to do with logic and category theory and it's pretty "math-like".

Thanks user. This is the first one my retarded self can actually understand.

>incels
Why do kids these days use this word? What happened to the good ol' "virgin"?

It's pretty weird to use this sort of newspeak when you try to be offensive. Targets may be unaware that a kid is trying to offend them if they don't understand the insult.

t. Boomer

This one is also a shitty meme.

Attached: 1527686352589.jpg (506x391, 52K)

>oop
data.DoSomething()

>fp
DoSomething(data)

the definitions change depending who your talking to.
oop is a style of programming where your types become associated with functions that take said type as the first or primary argument.
fp is a style of programming where your functions don't modify their variables(or at least don't change global state).

Attached: Df2EB5wV4AENSS2.jpg (1200x675, 82K)

virgin != incel
An incel is someone who is involuntarily a virgin

A virgin is just a binary status

But both words imply that "you are loser because you don't have sex".
And since virgin is a much more common word it has more insulting power, so using a very specific word that will likely be ignored due to being unknown looks counterproductive.

I agree, these young, liberal retards are introducing sjw words that change the language in a disgusting way. Makes me rage.

Incel is a portmanteau for involuntarily celibate.

when the list of sucessfully developed projects in a 20 year old language that I can download and try on my computer can fit on a napkin you know you're dealing with some stupid bullshit.

Attached: haskell.png (225x225, 2K)

Incel was coined by actual old days incels, not by the left

>liberal retards
you meant to say "libtards". please use that word in the future so it is easier for the rest of the board to filter your garbage posts.
Thank you for your cooperation.

Trying to fit in huh

Attached: kvAifNy_d.jpg (640x1740, 108K)

>waifus