Hacker News new | ask | show | jobs
by ChrisMarshallNY 1053 days ago
As always, when making "one-size-fits-all" statements, my answer is "It depends."

In many cases, I use inheritance and polymorphism, as well as extension, to make my code incredibly adaptable. It's basically habit.

It is not always so easy to scrutinize (even by Yours Truly), but I document it well, and the structure can sometimes make tasks that might take days, take minutes (This has happened many times in the project I'm working on, now).

A couple of weeks ago, one of the team needed a fairly large change to the operation of one of my screens. I was pretty reluctant, because it was one of those "Just one little change" things that actually translates to a massive codebase hit.

However, when I reviewed the code (which I hadn't touched in a while), I found that I had left some fairly good hooks in the base class, so it actually took about five minutes to give them what they wanted.