I mean you can either refine your code endlessly or make something that runs fine in good time. I personally prefer to refine things endlessly because I can't code fast anyway.
It's not enough to just notice, you have to also make an effort to improve your mistakes. That being said... I have written so much spaghetti code in my life that I should be granted a free Italian citizenship at this point lol
usually i develop the same stuff thrice within the same task:
- the naive implementation
- the implementation after understanding the problem better
- the implementation optimised to some direction (performance, readability, less code, testability, memory)
I try and write clean code because the guy who is going to be reading it in a few years time is a psychopath and knows where I live. That guy is very likely to be me.
Comments
Spoiler alert: It is not
Work all weekend refactoring it all to be prettier.
- the naive implementation
- the implementation after understanding the problem better
- the implementation optimised to some direction (performance, readability, less code, testability, memory)