Why do people prefer OOP over functional programming?

Why do people prefer OOP over functional programming?

Attached: download.jpg (600x414, 33K)

Because they are not sufficiently intelligent.

Why does that image lose quality every time it's posted?

>people

Attached: 1552629497495.png (828x1418, 166K)

>phone bad
>mindlessly slurping dicks on a line good
Such a deep message

functional code is too slow atm.

This is a meme with no basis in reality. Haskell is blazing fast.

Because the world is stateful and you're programming a state machine.
I'd much rather use an imperative language with first class functions than try to bend the problem to fit the clusterfuck of hacks that purely functional languages depend on to interact with the real world.

haskell can't even autovectorize a simple loop

It's because they're retarded manchildren.

Functional programming is useless for large projects

People use both where it makes sense

LISP machines are a spook

because to people, the world has a state, and things happen to parts of that state seperately.
people don't consider the world as passing through a series of total-state transitions

explain monads vs explain class,interfaces,...

it just werks

monad: a functional programming structure that enforces an order of evaluation, thus making guarantees about behaviour
class: a data structure with associated operations that can be performed on that data
interface: a set of operations

What if I like using many paradigms?

but if you do that you can't argue like an autist

To me functional programming means composing simple operations on data together to make more complex applications. This is closer to how I think and solve problems than by trying to model something as a hierarchy of objects that then communicate with each other in arbitrary and unfathonable ways

Why not combine both? Scala masterrace

Procedural > fp > oop

>composing simple operations on data together to make more complex applications
still sounds like OOP, honestly
>trying to model something as a hierarchy of objects
objects are simply the overall data structure. Indeed, many of them do not need any sense of permanence as some languages demand,
>that then communicate with each other in arbitrary and unfathonable ways
and this seems straight up strawman

Objects are more reusable than functions.

*allocates 2GB for intermediate data structures*
Nothing personal, kid, it's only fast where the compiler can figure out how to deforest the code or when you write inane shit like infinite lists that would never finish computing if it were evaluated eagerly, i.e. only in toy programs. But I kinda see your point, stricter code specifications allow for more code transformations so theoretically it could be faster.

And I ooop
Tsk tsk tsk tsk

CEASE.

Monad typeclass would just be called IFlatmappable in OOP.

>Because the world is stateful and you're programming a state machine.
I'd much rather use an imperative language with first class functions
Depends on the problem domain but yes a lot of problems are inherently stateful and are solved better by impure languages.

>than try to bend the problem to fit the clusterfuck of hacks that purely functional languages depend on to interact with the real world.
I assume you’re talking about haskell, and you’ve clearly never used the language. The IO monad is a fine way of representing impure code. You only miss a few small conveniences like assignment expressions and such which is a small price to pay really. The robust type system and do expressions avoid much of the boilerplate with monadic code. Purity does have measurable advantages too take this C code for example.
x++;
print(x);

It looks pretty innocuous but its actually non deterministic if you’re operating on x from multiple threads. With haskell you make these semantics explicit and you can define even higher level mutation abstractions like STM that can avoid situations like this all together. And it works naturally and is enforced by the type system. Its not wrong by default like in C.

Then why is apples software the best one? And their phones the best as well?

you don’t understand functional programming. most oop code does not compose. objects contain mutable state meaning the same function called twice may not return the same result.
you also don’t know what a straw man is. i’m saying that program flow is hard to follow in oop because it is a sequence of messages sent between multiple objects in a graph.
don’t waste my time replying until you learn something

So introduction to programming is the most advanced course at uni?

Java Streams or the Reactor libraries shows that OOP is powerful enough to support a functional programming paradigm by just adding a few new classes. Sadly the same cannot be said of functional programming "languages".