3 ms·
Hm.. my concept of beauty greatly differs from yours. This code looks completely mechanical to me, the opposite of "beautiful" (but it's great code nonetheless)
by brabel 6y ago
Hm.. my concept of beauty greatly differs from yours. This code looks completely mechanical to me, the opposite of "beautiful" (but it's great code nonetheless).
Beautiful code to me involves the creative composition of parts to form a whole in a way that seems obvious only in hindsight, but takes a form of "genius" to come up with.
I've written a few compilers and seen how the way you model the problem radically changes how easy/hard the implementation of "features" (as opposed to said "model") becomes. That, to me, is programming beauty, therefore, art. Code that model the problem so well that it brings up clear as water problems you hadn't event thought existed. Code that makes apparently difficult transformations trivial. I wish I could give you some examples, but I can't think of any right now. If you know of some, I'd love to look at it.
- phkahler 6y agoI can appreciate that distinction. The code I linked is mostly clean and readable, but it also does things IMHO very simply - that's not to say it does simple thing though some of them are. I was taken aback the first time I read the last function. I agree that choosing the right definitions and structures can make more problems solvable. That's a major driver of data structure choices - the things we build need to support the things we want to do, and getting that right is also part of the art.