Osmose

I make websites and chiptunes!

  • he/him

AKAs:
Lapsed Neurotypical
JavaScript's Strongest Warrior
Fake Podcast Host
Thotleader
Vertically Integrated Boyfriend
Your Fave's Mutual
Certified 5x Severals by the RIAA
Inconsistently Medicated
The Source That Views Back
Carnally Known
The Alternative


Homepage
osmose.ceo/

People would hate object oriented design a lot less if it was taught in like year 3 instead of year 1 of computer science because 80% of why people hate it is examples meant to explain it to someone who hasn't coded much before

Like, you shouldn't be introduced to writing your own classes until you've already worked with fetching and writing data to a database at least


You must log in to comment.

in reply to @Osmose's post:

I think there's a lot about how programming is taught where, like, there's best practices that solve specific problems that arise in large teams or large codebases or from maintaining something over years with shifting requirements. But in school, these are simply taught as "do it this way." The explanatory context isn't usually stated, and even if it is you don't feel it the same way when you're solo-coding a 200-line solution to a homework assignment that takes 1 week and is well-specified. Without actually understanding the problem they solve these practices turn into either cargo-cult dogma or railed against as pointless.

I have specific critiques of object-oriented programming, and think it's better-suited to specific niche domains rather than general programming. But also, the main concepts in it revolve around code re-use and extensibility, which is something that simply doesn't apply at the scales of code that you can teach in Year 1.

What's wild is that I rarely use inheritance but use classes all the time. I really like using them to encapsulate state in places where otherwise I'd have, say, 3+ methods that all take the same first 3 arguments. This is familiar to anyone who worked with pre-hooks React where almost all components were classes but inheritance was not recommended as a good way of reusing code vs composition tricks like higher order components.

Relatedly, I think a significant amount of the places where people think they should write multiple subclasses inheriting from a base class are better served by a single class whose behavior can be customized in the constructor.

IMO most complaints about object-oriented programming are complaints about inheritance, which is just one part of the paradigm and the trickiest to design with.