Redpill me on object oriented programming

Redpill me on object oriented programming

Attached: 1522157633953.gif (413x243, 51K)

Other urls found in this thread:

youtube.com/watch?v=cgVVZMfLjEI
twitter.com/SFWRedditGifs

It's shit

install gentoo

Why?

Do it yourself

dosomething(struct)
object.dosomething()

structs are objects
there is no difference

install smalltalk

> logic getting lost in stupid layers of inheritance
> initial static design never fits the real life dynamics and always becomes a tangled-up spaghetti shitfest
> impossible to properly do multi-threading without complicated synchronization
> community full of pajeets because java

Attached: poo_in_it.jpg (630x405, 31K)

retard

Programming is all about abstraction. OOP is just one way to achieve abstractions by providing capabilities like Composition, Polymorphism and Inheritance.

That said, it's a pretty complicated abstraction that can lead to inelegant solutions. It's fairly disastrous in a event-based or asynchronous system, especially if everything's mutable.

Objects can have a type though, which allows you and the compiler to reason about them in a relational manner instead of relying on naming.

Just black box my shit up fampai

namespaces are a feature

did it taste good?

Wrong.

more like objects are structs with function pointer fields where the function is dynamically assigned, the default fp is the parent class' function and in derived classes the fp is changed to something else

Attached: giphy.gif (480x270, 528K)

but (s)he's right you retard

Absolutly correct, but woah... def triggered some autism.

Object oriented programming is about more than just how you write down functions or methods.
It's about encapsulation of (mutable) data, abstraction, inheritance and polymorphism.
It's a way to design your program. Objects interacting with each other is a fairly easy concept to understand and therefore it's supposed to help you writing your program.

Suppose you have two classes, X and Y. Xo is an instance of class X and Yo is an instance of class Y.
To run a method F of class X on object Xo one may write Xo.F(). That would be the equivalent of F(Xo) in procedural programming.
But what would be the equivalent of F(Xo, Yo) in OO? Xo.F(Yo) or Yo.F(Xo)?
If a Pajeet immigrates to America, is it Pajeet.immigrateTo(America) or America.addImmigrant(Pajeet)?
There simply is no objective answer for these questions and the programmer will do whatever he thinks is right.

Object oriented programming is about keeping data that is used in a certain way together with the functions that act upon that data. Another thing is that you can guarantee that some data will only be accessed in a certain way. The classical example that instructors give is that you may want to change the way you get a certain value from a data structure.
If you access it directly, you will have to change stuff in a lot of places if you decide that the data should be accessed in a different way.

Honestly though a lot of the fancy stuff you can do with oop like inheritance is a complete mess.

It's a programming paradigm where everything is an object of an object of an object of an object and you can call the method of an object of an object of an object to simply your code.

Tell me how you can orchestrate a massive project without object oriented programming then

Only good post ITT

Hmm.. try looking at the linux kernel then. Maybe the image editor GIMP?

youtube.com/watch?v=cgVVZMfLjEI

Glorious answer

I'm non binary you fucking nigger

good manager
good programmers
sane goals

tech is not magic, tech is fancy sand

>Redpill me
KYS

>good manager
>good programmers
>sane goals

No budget for that sorta thing. Better hire 100 scrubs.

OOP is a good supplementary paradigm that is incorrectly used as the only paradigm in code. personally i have a better time reasoning about procedural C code with healthy use of descriptive functions and structs

Better than if else if else if else...

Remember the golden rule:
Use the right tool for the right job.

Depending on the language you may have different options to achieve your goal.
The main drawbacks of OOP is when people go overboard unnecessarily, make interfaces and abstractions where they're not needed or abuses inheritance.

It's not easy to learn when using something actually makes sense, sadly that's something that requires experience.
I would personally advise against doing premature "enteprising", try to go the simplest route first, because chances are that you'll end up needing to change a lot of stuff if you start too eagerly with dozens of interfaces and abstractions (wasting your precious time).
That said, it's good to think ahead, if you feel you may need something, don't take actions that you might regret later.

actually it's EXACTLY the same except with lots and lots and lots of shit smeared all over it

Its still F(Xo, Yo)

He cant tell, he probably only wrote some batch files in his life.

You could do that, but it is not the object oriented way of doing it.

OOP is one of x billion posts written by people who get paid to write enormous shitposts for (you)s

occasionally someone will succeed in selling one of these shitposts to some sucker and a meme is born. cue x billion businessmans instantly swarming to cash in on the hot new shit. cue undergraduate course requirements and resume keywords

don't buy the hype, innoculate yourself by learning the basics of what the chips actually do (i.e. learn some assembly), what compilers to do your code to get it to the chips, grind your head into ash practicing them abstract mathematical thinkings by writing actual programs that do actual things for fun (read: games) then write the simplest thing that will get the real job done using whatever tools you will inevitably be required to use for work

then get the hell out and become a subsistence famer