Hacker News new | ask | show | jobs
by bitwize 7 days ago
If your code is a low-stakes one-and-done and it works in the end, messy code is forgivable. Undertale looks like Yandere Simulator inside; nobody cares.

But if your code is something that needs to be maintained over time and/or has constraints in terms of security, availability, etc., like virtually all code is, then yes: clearer, better factored, more readable code is a big part of the product because it's a massive favor both to yourself and your successors when changes have to be made and results in quicker changes, lowered costs for changes, and higher quality on metrics like security. Even if I'm writing a game—I'm auDHD, so if the initial code is garbage (and I've written a lot of garbage code) I'd be loath to touch it later. Better factored code is easier for me to revisit and improve upon with time. So I make it a point to continuously improve how I structure code from the jump to stave off it turning into an unpleasant quagmire later. This is especially important when you consider that oftentimes in business, the first draft that could possibly work goes right into production. Rewrite? What do you mean, rewrite?

Fabrice is still fucking brill though. He'll slap something together that's a holy shit idea as easily as I take a dump.