Ancestors

Written by Hellfire103 on 2024-11-14 at 10:12

TIFU by not using objects in my object-oriented programming coursework

https://lemmy.ca/post/32965379

=> View attached media

=> More informations about this toot | More toots from hellfire103@lemmy.ca

Toot

Written by tyo_ukko@sopuli.xyz on 2024-11-14 at 15:41

You did the right thing. OOP was invented by people who were worried about their job security to obstruct others from understanding their code.

=> More informations about this toot | More toots from tyo_ukko@sopuli.xyz

Descendants

Written by LavenderDay3544@lemmy.world on 2024-11-14 at 18:40

Obfuscation Oriented Programming as I call it

=> More informations about this toot | More toots from LavenderDay3544@lemmy.world

Written by marzhall@lemmy.world on 2024-11-15 at 12:06

Damn I’m stealing that

=> More informations about this toot | More toots from marzhall@lemmy.world

Written by Lightor on 2024-11-14 at 19:18

OOP is pretty readable though. What would be the alternative, functional programming with no ORM?

=> More informations about this toot | More toots from Lightor@lemmy.world

Written by electricprism@lemmy.ml on 2024-11-14 at 20:06

Right, most things are a fine thing in moderation.

=> More informations about this toot | More toots from electricprism@lemmy.ml

Written by tyo_ukko@sopuli.xyz on 2024-11-15 at 09:14

Well, bad code is bad code regardless of the paradigm. I’ve just had bad experiences rewriting some horrible OOP codebases and opted out to use as much functional style as C# allowed me to.

The main problem, as I see it, is that OOP encourages unnecessary abstractions and inheritance. These should be used as little as possible, because they typically increase complexity and make code harder to read and untangle. As an example, I’ve seen people define interfaces that don’t essentially define anything.

Another problem is that OOP encourages mutable member variables. It’s very annoying to try to understand code where class C inherits from class B that inherits from class C. Good luck debugging when the methods of C modify a variable declared in A in subtle ways.

As an idea OOP is very appealing. When I was younger, I would be thrilled to start designing a class hierarchy and interfaces when encountering a new programming challenge. Now I just try to think how to make things as simple and modular as possible.

=> More informations about this toot | More toots from tyo_ukko@sopuli.xyz

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113482063355070899
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
271.610397 milliseconds
Gemini-to-HTML Time
1.933445 milliseconds

This content has been proxied by September (3851b).