coolbean,
@coolbean@seafoam.space avatar

read about the supposed good parts of oop

actually its own entire paradigm and core to modern functional programming

:neocat_woozy:

18+ coolbean,
@coolbean@seafoam.space avatar

like, every time i read about OOP i leave further convinced that its just a tedious way to apply other paradigms in a way that makes them inconvenient while contributing nothing useful of its own

like, when i started out and knew fuckall about programming theory i just hated the abstractions it provides because i found them unintuitive

then i saw encapsulation through a module lens rather than an object lens, and suddenly its like “oh yea that’s gotta be indispensable when working in a group | on a large long-term project | on a library, shame its tucked into the unintuitive set of abstractions

then i saw the bold claim that actually its polymorphism that makes OOP special, and immediately heckled it because the only prerequisite to ad-hoc polymorphism is a type system and something roughly equivalent to a switch statement (if-else does the trick)

but now im looking into the claim deeper and it just keeps becoming more wrong? cause even the more advanced parametric polymorphism (generics/templates) you find in the more well-known object systems (but not all, CLOS notably lacks this) isn’t just not specific to OOP but its an essential core feature to haskell and other type-heavy functional languages that give me a migraine (the one constant between all of these)

astrid,
@astrid@fedi.astrid.tech avatar

@coolbean yeah polymorphism is not unique to OOP, it's probably the most used thing in functional languages. like passing a function into another function is polymorphism. a lot of OOP design patterns don't need to exist if you just had closures, which c++ and java didn't for the longest time lol

encapsulation, too, is really good but also not unique to OOP. technically, defining a public header file in c that's only a subset of the functions you implement is a form of encapsulation

astrid,
@astrid@fedi.astrid.tech avatar

@coolbean ironically, I think rust does c++/simula style OOP the best because it's actually not a bad model if you're doing the whole memory safety without gc thing. but rust also had the 30 years of hindsight to drop bad OOP features like inheritance

coolbean,
@coolbean@seafoam.space avatar

@astrid yea but also whats left when you take out the inheritance? thats just a grouping of other paradigms at that point

its only object oriented if it comes from the inheritance region of france, anything else is just sparkly modular programming

18+ coolbean,
@coolbean@seafoam.space avatar

@astrid i have to respect dogmatic OOP for bringing together genuinely good and useful paradigms in a way where they’re all designed to interoperate neatly, and somehow fuck it up so badly i don’t want to use it

astrid,
@astrid@fedi.astrid.tech avatar

@coolbean I guess like, expressing things in terms of objects that do things because it's a bit more comfortable to do that in rust than to pass around objects into functions? Idk tho

coolbean,
@coolbean@seafoam.space avatar

@astrid thats the thing tho, an object without encapsulation is just a datatype that holds functions and data and lets you access them by defined names

…like a struct

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • everett
  • DreamBathrooms
  • modclub
  • normalnudes
  • ngwrru68w68
  • magazineikmin
  • Durango
  • ethstaker
  • Youngstown
  • rosin
  • slotface
  • InstantRegret
  • kavyap
  • thenastyranch
  • megavids
  • osvaldo12
  • Leos
  • cubers
  • tacticalgear
  • khanakhh
  • mdbf
  • GTA5RPClips
  • anitta
  • provamag3
  • cisconetworking
  • tester
  • JUstTest
  • lostlight
  • All magazines