Avoiding OOP

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Avoiding OOP

Post by airstruck »

drunken_munki wrote:OOP is still procedural, no matter how you perform your mental gymnastics.
Sure, you could look at it as sort of an extension of procedural programming, but they aren't the same thing. Procedural programming isn't OOP. That's why they have two different names. Otherwise we'd just call everything procedural programming, and there would be no reason to make a distinction by calling anything OOP. Of course, that's the same distinction I was referring to.
As for the myth that it is 'reusable' I am laughing right now. I have worked on several production code bases and team projects; I would classify NONE of their code writing in OO was 'reusable'.
Sucks that you got put on some poorly written code bases. It happens. Doesn't mean code reuse is a myth, though.
This for me a huge clash what OO claims to solve, which is the problem of designing code without knowing what is under the bonnet (as far as I am aware).
Are you referring to polymorphism? I'm not sure what you're getting at here, are you claiming polymorphism somehow doesn't work or isn't useful?
What is that, ~19? classes to make a duck flap and quack? You think this is 'clean and tidy' and 'well organised' code. I'm dying.
Sure, it's nuts. That's not an argument against OOP, it's just an argument against classical OOP. This is why we're using Lua instead of Java (or JAVA, which isn't actually a thing). If you read this thread and related ones carefully, you'll notice some discussion of whether such heavily class-based design is necessary when we have first-class functions and ad-hoc object composition is so easy. In my view you certainly wouldn't need all those classes (or any classes) to model a handful of ducks.
I have always married OO and pure procedural DDD together, which feels far more efficient use of one's toolbox.
Agreed.
Also, a lot of people a talking about 'design patterns' here. The only reason these things exist is because of Code Smell and lack of features in the language or OO paradigm itself
It's not necessarily lack of features. Languages can be lower-level than that. It's not Lua's job to provide an ECS-like pattern, or an object pool pattern, or whatever. It's not just OO either, any paradigm has tradeoffs (as in, you see monads in FP but almost never anywhere else). And classical OOP suffers a lot more than "object-based" or "method-based" OOP or whatever you want to call the kind of OOP that doesn't lean on classes too heavily, where patterns like factory and decorator become so trivial to implement that maybe you don't think they exist anymore (but I think they still do).
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests