Why is OOP so bad?

Why is OOP so bad?

Why am I too dumb to learn a functional language?

Attached: 1526962159391.png (2251x3703, 2.71M)

Other urls found in this thread:

ccs.neu.edu/home/matthias/BTML/
answers.unity.com/questions/143382/accessing-an-object-through-a-direct-reference-or.html
twitter.com/NSFWRedditImage

OOP is a pajeet meme

>functional language
is haven for morons, can read books all day, teach other retarded people, and never work

because you don't understand abstraction.
now go shit in your global mutable state codebase, pajeet.

what is this faggot tumblr comic

RAII is the only thing you need from OOP.
This, mutability must be a optimization step, not a design decision.

>Why is OOP so bad?
Because languages should not be designed with the assumption that the programmer is an idiot.
>Why am I too dumb to learn a functional language?
You aren't approaching them the right way.

Also:
>ruby not the hipster faggot
>lua and java not niggers

It works flawlessly in Unreal Engine.

As an aside, how the fuck do you get references in Unity? In UE you can use a variety of events or go through the map object to transfer them.
I wish Unity tutorials weren't all pajeet-tier crap that is all the same retread of the same three things, with all of them implemented badly.

It's not. All OOP really is, is structs with functions attached the same effect can literally happen with C functions with the struct being the first parameter, being referenced by a pointer

>learn a functional language
Go on libgen and get the book A Little MLer ccs.neu.edu/home/matthias/BTML/
If you don't know what recursion is read A Little Schemer, can do it with paper and pencil. These books literally train your mind through socratic/drilling how the paradigm works until you 'get it'.

>Because languages should not be designed with the assumption that the programmer is an idiot.
>suggests language with garbage collector

It's not inherently bad. The problem is that people for some reason think you need OOP to do abstraction, which is nonsense.

Attached: 1417249358824.gif (500x252, 985K)

>Why is OOP so bad?
It's not. It's a completely reasonable approach to a number of problems, so long as you think about what you are doing.

answers.unity.com/questions/143382/accessing-an-object-through-a-direct-reference-or.html

It's also completely possible to write Unity programs in any language, like C, Rust, ML or OCaml, then just compile directly to C# bytecode.

In many cases, GC is more efficient than manual memory management when you don't need that kind of control. It is a powerful tradeoff while all OOP does is make the language more convoluted for its own sake.

>Why is OOP so bad?
It isn't inherently bad. But it's the paradigm that's most used throughout the industry, so most of the bad code (which there is a lot of) written by code monkeys (which there are a lot of) is OOP code, so it gets a bad name from that.
>Why am I too dumb to learn a functional language?
Probably picked the wrong major, friendo. Unless your goal is to become an OOP code monkey.

IMPERATIVE MASTER RACE

I do not know what you mean when you say "OOP". OOP is a method of code isolation and it is critical task in programming. There is nothing wrong with OOP itself.

where pascal?

>All OOP really is, is structs with functions attached the same effect can literally happen with C functions with the struct being the first parameter, being referenced by a pointer

it is because of idiots like this that we shall better start considering software engineering as more important than mathematics when it come to programming. otherwise, we are all doomed.

Attached: anon idiot.png (1679x943, 806K)

Prove me wrong

There is a reason why functional programming is barely used in comparison.

What would php be if javascript is already la creatura?

look up "convenience"

>literally on wikipedia

>Objects can be thought of as wrapping their data within a set of functions designed to ensure that the data are used appropriately [...] each object is capable of receiving messages, processing data, and sending messages to other objects

OOP isn't bad, it's just that functional programmers are incapable of it, and vice versa.

One thing I don't get, why having a lot of empty getters and setters without any logic is bad?

You are missing the point.

>too dumb to learn a functional language
>thinks OOP is bad
These are the teenagers making epic coder memes

Giv paranoid Rust ebony waifu

OOP is awesome if programming is a means to another end.

If you make a living writing programs for others, OOP is shit. If you do research and just need to do some quick and dirty thing that'll work once, but has to work, something like Python may be it.

>t. translation studies major who works with NLTK

Isn't writing programs for others a means to another end?

a struct in C is just a data type, putting pointer to procedures inside a struct type doesn't make it an object nor an abstract data type. you are confusing a concept with its implementation. An object is a data abstraction technique where the data is hidden by a set of operations. C can't do that.

I say OOP when I drop something.

matlab is fucking dogshit. it's slow as fuck and requires proprietary software to even run the code. the only people that use matlab are those too retarded/stubborn to use python.

Is Matlab a reference to Texhnolyze?

It's not that it's inherently bad, but it is used very badly by pajeets.

Opaque pointers.

>thinks OOP is bad
>gl programming a GUI or anythiing that is remotely complex

OOP is good. People not fond of it are probably braindamaged or never built a large codebase system. Chances of people wanking over haskell being unemployed students or NEETs or useless professors past their prime is 99%

then how you would call the methods?

By a set of operations that operates on these abstracted data types.

>method
>abstract data type

Attached: wow anon.jpg (884x574, 78K)

This explains why I hate making GUIs so much, wayyy to many objects
Or is that just because Java Swing?

JavaScript/HTML is pretty EZ, but this board declares it as cancer
Python/Jupyter is what I use for quick display

>An object is a data abstraction technique where the data is hidden by a set of operations.
typedef struct dog dog;
dog *newdog(const char *name);
void killdog(dog *self);
char *getdogname(dog *self);

that's a really really really loose equivalent.

It fits exactly the given definition, unless you have a stricter definition.

The only correct answer ITT.
OOP is not bad per se, but it's incredibly easy to abuse it.

>dog *newdog(const char *name);

what the fuck? void newdog(const char* name, dog* d); you sick fuck

not really. C doesn't have the abstraction to really prevent abuse that real OO has. it's extremely flimsy precisely because C has shit typing and no such thing as private struct members.

>void newdog(const char* name, dog* d);

Why would you do that, are you retarded? Go read any ABI.

>Lua
What did they mean by this

Oh in I meant to type
dog newdog(const char *name);

that's an abstract data type, not an object.

//oop

void sort(Sortable object)
{
// dynamic dispatch
object.sort(); // how do you do this in c without breaking abstraction?
// you can't; you need methods for doing that
// and C lacks methods.
}

//adt
void sort(Sortable adt)
{

// explicit dispatch
match(adt)
{
case IntArray ia: IntArray_sort(ia);
case FloatArray fa: FloatArray_sort(fa);
....
}
}

uh so I can stack allocate dog u fuck. why the fuck would I want some static dog from some function or a function that returns memory from god knows where that i may have to free or even munmap if it's extremely weird?

see

>It works flawlessly in Unreal Engine.
This is the only good thing you can say about OOP is that it works well in game engines and GUI toolkits. Game engines are a large, static, monolithic blob of data that installs on your computer and works well with inheritance because you are constantly spawning instances from pattern objects. For everything else inheritance breaks down and is just a very constraining way of doing things to the point that you need to learn patterns to undo the constraints that classes and inheritance creates. Its interesting that when you start using functional programming languages the need for patters disappears as functional languages are inherently capable of all the abstractions that are described in design patterns.

Show me a web browser, IDE or some enterprise software that is coded solely in a functional paradigm.

Dynamic dispatch is not OOP. Inheritence is not OOP.

ya and the same problems. as i stated. taking a struct as a return value is just asking for memory issues for literally no good reason.

Once again, as I stated, go read any ABI. 99% of the time a struct return value is considered as a pointer parameter. I don't know of a single ABI that doesn't do that.

>Inheritence is not OOP.
true.

>Dynamic dispatch is not OOP.
yes it is and its known as the fundamental difference with ADT (read william cook paper for a deep analysis). read simula, read smalltalk. you communicate with an object by sending a message to it; the concept is dynamic in its very core.

>Show me a web browser, IDE or some enterprise software that is coded solely in a functional paradigm.
a web browser is a static GUI system, so as I said it works well with OOP

as for enterprise software, I will agree that the dominance of Java/C# has to do with how well it is for average programmers to make sense of pure OOP code. But I would also say that the forced-OOP in Java has reached its limit and its time that programmers start learning how to use module based languages (ie Go) as Java is really holding back the flexibility of enterprise software

ok and what's your point? just because coding to abi's forces you to do stupid things like passing opaque structs or pointers to opaque structs doesn't mean internal code should do this shit.

It's not bad, as much as unnecessary in many situations. Teaching students only in memory safe, restrictive and strict OO inhibits their ability to work in other systems, and doesn't force them to think at enough different levels of abstraction at once. Students need to be stretched, not coddled, in order for them to learn. The comparative programming course is good, but doesnt force students to really use any language enough to learn from it, which they need to do if they're going to be able to distinguish where you should and shouldn't use OO or FP.

Should the average graduating cs student program in C/C++/asm their first job? Hell no. But they'll be better at whatever they do if those were what they learned on.

>and doesn't force them to think at enough different levels of abstraction at once.
you are wrong. oo allows you to climb further the ladder of abstraction techniques. because oo force you to reason through operations instead of raw data manipulation, you can now apply on a multitude of interface abstraction techniques (known as design patterns).

>Why am I too dumb to learn a functional language?
You aren't. You just never gave it a serious try knowing you're learning something different and tried to code in a functional language.

>go
>better than java
lmao

>>go
>>better than java
>lmao

Attached: Girls-Laughing.jpg (1080x720, 565K)