I don't understand object oriented programming. Functional programming was so easy to learn. It was intuitive and mathematical. But OOP is so much more contrived. I have failed to even see the point so far. It just seems to be like OOP is just compulsive organisation autism manifested in code.
I've only been using programming for mathematics, though, so maybe I'm biased. The only reason I would even bother with Java instead of Haskell or Python or even C++ is that Java is so much faster.
Anyone have any tips for grasping it more easily?
Think of every object as a type of variable and
Think of methods as a group of functions based around manipulating this type of variable..
>>62078374
i feel you senpai
i get infuriated when i need to use a perl module and the only interface to it is object oriented
>>62078404
This one.
Don't overthink what object is.
>i'm too stupid to learn arrays and pointers
>>62078416
hold on i didn't write 'senpai' in that reply
does 4chan automatically change 'f\a\m' into senpai now?
senpai
senpai
>>62078429
baka desu senpai
>>62078404
Yeah, thats fair enough, but what kind of function permits the changing of its own argument later in the code? Why bother with all the added syntax of creating object types and all that shit when you could just as easily do the same thing with a lot less effort with functional programming?
>>62078452
The basic idea is that you want to create an interchangeable thing that can be replaced, reused and only needs to be modified at one place.
>>62078374
I learned java first and OOP is the only kind I know. What do you find so confusing about it?
>>62078374
>I've only been using programming for mathematics
lol
yours is a surprisingly common plight my friend
OOP is a good idea that was overused to the point where it has become a shitty meme.
>>62078374
what's hard to understand about OOP?
>>62078429
how fucking new are you?
>>62078374
>is that java is much faster
>>62078429
desu t/b/h
senpai f/a/m
baka s/m/h
I've always had an issues to see when the object gets copied in OOP ans thus what's shared. Thread-safety is also hell. I really love what Go did.
>>62080337
Most OOP languages just make everything reference types.
I never really liked that idea.
>>62080259
It was an order of magnitude faster than C++ for finding primes, despite using the exact same implementation
>>62078428
What is so mystical about arrays
>>62081519
(you)
>>62078490
Organizing files properly on functional programming also acomplishes this. Not that I have anythig against OOP
>>62078374
It's all the same thing in the end. In functional you'll keep state as input argument to recursive functions or similar. In OO you'll put it as members in some syntactical-sugar construct called a class. I really don't see why this is such a big deal to some people. What sucks is bad, unreadable, unorganized code, which is trivial to produce in any language.
>>62078374
desu
>>62078374
>t just seems to be like OOP is just compulsive organisation autism manifested in code.
That is pretty much what it is.
>I've only been using programming for mathematics, though, so maybe I'm biased.
Not biased so much as underexposed. Mathematical programming tends to be short and sweet, because the underlying mathematics is short and sweet. Software that does mundane user-facing things, like a text editor, or a game, or an office bookkeeping thing, consist of vast amounts of interacting crap. Compulsive organization autism is necessary to make sense of it, and OOP is a tool for doing so.