Short-term profit or long-term prosperity
David Maister asks, in a business turndown, do you respond with cost-cutting measures, such as layoffs of junior personnel, or do you reduce the profitability at the top, redirecting the efforts of your top people to long-term growth while the junior people attend to the reduced amount of immediate work? As he says,
As always, I have to stress that this is not a moral issue but one of pragmatics.
As I read through the comments on this post, I came across one that noted this was a case of
The classic fight between short-term “success” and long-term prosperity.
Suddenly I was struck by the parallels between this dilemma faced by business owners and those faced by software developers.
Imagine it’s getting late, and you’re tired from a long day’s work. A feature you’re implementing has exceeded your estimation. It should have been done by now, but there were some unexpected complications and you’re still working on it. You just want to get it done and go home, right?
- make it pass the test, check it in, and go home, or
- think about how this code fits into the bigger picture, and why you ran into those unexpected complications, make this code clearly reflect this code’s role in that bigger picture (perhaps extracting a class to explicitly acknowledge a secondary responsibility), as well as making it pass the test.
Which is better for long-term prosperity of the code?
Have you faced this dilemma before in this code base? Are those unexpected complications a consequence of code that was left a little less than clear in the past?