3 ms·
> Beautiful code gets rewritten; ugly code survives. Ever stop to think that maybe this is a good thing? That code doesn't exist to be beautiful -- code exist
by crazygringo 8y ago
> Beautiful code gets rewritten; ugly code survives.
Ever stop to think that maybe this is a good thing?
That code doesn't exist to be beautiful -- code exists to get the job done. Beautiful doesn't mean it's not also useless or arbitrary or over-architected, while ugly can be a healthy balance of competing priorities -- maybe not clean, but a good series of necessary real-world compromises.
This isn't to defend all (or even most) ugly code as good... but that equating beauty with good comes across as terribly naive.
- erikpukinskis 8y agoThey didn't say it was a bad thing. Just that it's what happens. I've noticed lately that people seem to assume that if you say something negative, you're trying to make a big existential claim about its place in the universe. Like when people criticize masculinity and then we are all aghast as if they said masculinity needs to be systematically extracted from all aspects of culture. I'm not sure which side of the equation needs to be more careful though. Maybe, in the internet age with the globe as your audience, if people are criticizing things they need to add a bunch of caveats to make it clear what they're not saying.
- crazygringo 8y agoThe first sentence literally calls it the "tragedy of software engineering". I don't think I'm making an unwarranted assumption that the author means it's a bad thing.
- yourbandsucks 8y agoNot to mention, often times the business requirements themselves are ugly. Ugly but clear is the lowest possible distance between code and purpose. I've spent so many hours obscuring the true purpose of chunks of code just so it can hit some zealous reviewers checklist of patterns they like..
- rntz 8y ago"Getting the job done" is a short-term goal that often comes at the expense of long-term well-being. For example, the endless parade of backward compatibility layers on top of backward compatibility layers. Each got the job done at the time. And each makes it just a little bit harder for future programmers to get their jobs done. I think a sense of beauty can let us know that something is amiss with the bigger picture. It can provoke us into stepping back and ask: what is actually necessary? Which jobs really need doing, and at what cost? Certainly, short-termism is not the only failure mode when writing software. Abstraction for abstraction's sake is another.
- slavik81 8y agoI dislike "beautiful" as a description because it means different things to different people. I've seen a similar, narrower claim before: > Easy-to-change code tends to be changed. Hard-to-change code tends to endure. Thus, a codebase tends to become harder to change over time. I can't recall exactly where I saw that version, but I like it better. It's more clear what it means and why it's true.