Hacker News new | ask | show | jobs
by xbfjvusb6 1334 days ago
I find OOP fine but it's not something you can just let rot. You need to be ok with redefining classes and refactoring things around the new boundary lines regularly as requirements change.

This requires a testing suite that gives you confidence to make these sweeping changes quickly. Without it, it's not a fun way to work.

Also, you don't have to go all in on oop. I like to use procedural most of the time only defing objects for things I find more easy to reason about as objects.

For example, I'll write the command line interface in procedural that looks a lot like a complicated bash script and then define objects that do the work. This often results in objects not really changing much because they're not defined until later in development when their needs are well known. The place that changes is usually feature switches, command toggles, output formats, and the like. All that can be objects if you want but for the most part a function or two goes a long way and results in easier to change code.

1 comments

Your post reminds me of this scene from Indiana Jones and the Last Crusade: https://www.youtube.com/watch?v=nGTEXqudVJM