|
|
|
|
|
by darkerside
2548 days ago
|
|
Examples aside, here's how I think about elegance. Sometimes you run across, or imagine in your head, or accidentally stumble into writing some Especially Good Code. The code just seems to work, extends easily, repels bugs, scales appropriately, etc etc. I think what's happened in these cases is, typically by luck, you've written code that matches up very simply and beautifully with an undescribed and perhaps indescribable pattern that's present in a larger problem domain. Like poetry, your code expresses the nuances of that problem in a way that prose simply can't (efficiently). You can't always tell or explain what's so great about it, but working with it is a pleasure, and it rarely lets you down. To me, that's the ideal of elegant code. |
|