DEV Community

Discussion on: Bad code isn't shameful

Collapse
 
jpalvis86 profile image
Juan Pablo Alvis

I read this several times trying to understand your point because I do feel we shouldn't accept bad code, I know we can't always write good code but the first time I read this I got some sense of tolerating/justifying bad code in which I disagree completely.

Some things to consider:

  • Sometimes there isn't time: Strive for having more time the next sprint/project to make it good from the start or add a TODO to improve it later.

  • Sometimes there's legacy code: Make it better at least a little bit.

  • Sometimes the code was good when we wrote it, but the requirements changed: Good code should be flexible and maintainable to allow changing it without too much pain. If there's anything worse than writing bad code, it's worsening good code.

TL;DR: We can't always write good code, but we should strive for it and if we don't feel bad for doing it badly, then it will never improve.