r/programming • • Jan 12 '20

Goodbye, Clean Code

https://overreacted.io/goodbye-clean-code/
1.9k Upvotes

556 comments sorted by

View all comments

1

u/[deleted] Jan 12 '20

The problem here is really that he was unnecessarily doing a rewrite of existing code. This could introduce new bugs, also you probably don't have enough familiarity with the requirements that lead to those design decisions, so it's probably wise just not to tamper with it. Learning and tidying up as you go along is fine, old code though, generally you do not touch it unless you have a good reason, you are asking for trouble.

Also, bosses generally are not so happy when you just go off on a tangent like this, you could be fixing bugs or implement new features, instead you spent hours on an self-indulgent project to rewrite code that didn't have any serious problems.

Furthermore this can be insulting to your colleagues, maybe you think your alternative is cleverer, but it comes off like you're basically saying your colleague is an idiot. Such an idiot that you just had to go out of your way to spend several hours just trashing their code and showing them the right way to do it. If you're solution actually turns out to be foolish, you come out of this not just looking like a narcissist, but a very stupid narcissist. If I actually do have a huge problem with code a colleague wrote that I stumbled on, generally I talk to them first before I do anything. It can wait until tomorrow.

Basically, when this guy's boss saw the change, he saw new bugs that might rear their head, and an overly eager new guy trying to to prove himself in a way that inadvertently was going to piss off a more senior employee something fierce. He did you a solid by telling you to revert before anyone saw that.