Maintainability vs Job Security


#1

Is it best to write clean simple code that is easy for your successors to maintain,

or,

is it best to write complex spaghetti code that makes you a boat anchor at your current gig?


#2

Wrong question. Which one of those is more satisfying to you?


#3

Clean and simple code, no doubt about it from me. There’s a couple of factors you don’t seem to have considered:

Forget about your successors - what about your co-workers now? Would you rather have a reputation for writing good code, or an unmaintainable mess that only you can understand?

Anchoring yourself by making something only you can maintain may seem like a good idea at first glance, and might work in the short term. But then what happens when you want to take vacation time, and something breaks/a bug is uncovered? If you’re the only one that could fix it, either your vacation is cut short or it has to be left unfixed until you return. If your projects become known for things like this, you are less likely to be put on new/interesting projects.

Oh, and it’s not likely to remain maintainable by only you. There’s always someone better, and if they get hired, they could probably supplant you while writing more-maintainable code at the same time.


#4

Never do a bad job because you feel it somehow gives you job security. In the long run, it doesn’t. And ultimately your siloed knowledge of some obscure sub-system becomes an anchor around YOU.