What does it mean to write “good code”?
In a discussion on coding quality, and how you identify it, I came across a discussion on testing people's coding ability by getting them to show how they would swap two values using a piece of code to achieve the objective. Two key solutions were produced:
- Introduce a spare variable to do some pass the parcel of the values or:
- Use some bitwise operators.
There then ensued an argument on which was in fact the better solution (I'd be leaning towards the first option while being aware that the second one exists, but may not always evaluate as expected depending on the values in question).
Bearing in mind the story of Mel the Real Programmer, I am interested in knowning how you evaluate code as being elegant or not, and is succinctness a key feature of elegant code.