| There’s a time and space for shitty code. Something you write once, as quickly as possible and throw away. Anything else, that ships to any kind of production environment, needs to be reliable and maintainable. Shitty code is a false economy. Time savings often fail to materialize if not out right end up costing more in maintenance. Good code is not something extravagant nor expensive. It’s something simple that just works and looks obvious to anyone who looks at it. Good code is not over designed code. The difference between shitty code and good code is often the difference between a prototype and something production ready. Take the prototype code you wrote, careful think of all the edge cases, maybe test them, rename anything confusing, comment non obvious things if any, and refactor, throw away as much as you can until every line matters. Good code does not trouble your sleep because you know you did everything you could to ensure it is reliable and even if there is a bug, there’ll be enough info logged and the code is so clear, that fixing the issue will be obvious. If you’re in the habit of writing good code, you will become better at it with practice and be extremely efficient. If you’re in the habit of writing shitty code, you’ll have to write more shitty code to work around shitty bugs and spend endless time chasing mysterious problems in production. |