4 ms·
> especially with newer developers My experience is junior and senior developers fall for this. > Often the original paradigm was chosen for a reason True, b
by habitue 6y ago
> especially with newer developers
My experience is junior and senior developers fall for this.
> Often the original paradigm was chosen for a reason
True, but the reason is often:
- we didn't understand the problem domain as well when we wrote it
- it was written this way because it needed to integrate with a system that existed at the time but no longer does
- there was a guy who was really into X and he insisted on writing it this way. He no longer works here and no one wants to touch that code
- It was written by an intern
- It was written by a bad software developer (you're not morally bad for being a bad software developer, but they are real, and they write code)
- It was written as a prototype and was supposed to be thrown out
- It was written by me, and the fact that you want to rewrite it makes me feel bad
> Any ideas on how to prevent this?
Exploratory refactoring is actually a really good way to understand code deeply. Sometimes the refactor is bad and your throw it out, that's ok, you learned something. This applies to developers refactoring code, they learn the reasons for things as they rewrite it.