Comment Re:Elegance only exists in textbooks (Score 1) 373
I must admit my primary goal was security and I have been trying to be strict on security problems usually others have and that usually are defined as weaknesses. However, you also need to work with usability and effectiveness for having something really usable.
For me, elegant code helps you to express your needs following a very clear and understandable way, be for you in the future or for others to maintain. That code not only needs to be clear, but also needs to be secure and efficient. I do nothing inventing a beautiful piece of code that will use 100 times more CPU because it has been excessively layered, or that permits me to create beautiful pieces of crap that will leak any possible memory and to produce many different types of concurrent problems.
Elegant doesn't mean to hide responsibilities. I don't believe in the garbage collector "for everything" philosophy, because you lost the control on what you are dealing with, even in places where it is a must to have very precise control. Elegant code is clear, having well defined preconditions and postconditions, with no surprises. Every new has a delete (everything be created must be destroyed), and your programming rules are logical and built up your understanding about the problem you are resolving.
In a few words : elegant means you are in control.