3 ms·
The cleanliness and "refactorability" of my code improved significantly when I drastically reduced the amount of subclassing I was doing. I wouldn't go so far
by avinium 8y ago
The cleanliness and "refactorability" of my code improved significantly when I drastically reduced the amount of subclassing I was doing.
I wouldn't go so far to say "never subclass", but I'd say most of the time, you won't need to subclass.
- hackits 8y agoI would say you `never never subclass` most of the time its just proves your design is turning into a taxonomy. You really don't need classes for a OOP language, its just simply a convention that developers use that is convenient.
- rhapsodic 8y ago>The cleanliness and "refactorability" of my code improved significantly when I drastically reduced the amount of subclassing I was doing. >I wouldn't go so far to say "never subclass", but I'd say most of the time, you won't need to subclass. Yeah, I would agree with that. A lot of OOP mechanisms like inheritance, or design patterns, get overused a lot. I'm not saying it's what you were doing, but I've seen it mostly in code written by newish programmers. It seems that once the concepts of OOP click in their mind, they get excited and eager to put them to work, so they use them where they're not really appropriate. I was definitely guilty of that, way back in the day. But once the novelty wore off, and I realized that I was just creating over-architected messes, I quit doing it.
- avinium 8y agoLearning Clojure was, IMO, the best thing I could have done to improve my development skills. It helps you realize that programming is simply about data, and how you manipulate it. Design patterns, OOP, conventions, etc are all just secondary tools that sometimes help you do that.