I am looking for examples of reasonably short, but reasonably complicated segments of code (objects, functions, classes, a particular set of variable names, etc) that strike that perfect zen like balance of self documentation and implementation elegance.
It could either be something you are really proud of or something that you came across and experienced an "Aha!" moment of enlightenment.
Some potential criteria (not all need to be met in a single example):
I am looking for an example snippet followed by a brief commentary of what makes the code special. Of course the best examples will require minimal additional commentary because they are well documented.
Note to moderators: I am new to stackoverflow, so if this question is somehow not appropriate or must be closed, can you provide an explanation of where it runs afoul of stackoverflow's norms? I am not intending to waste people's time.
The goal of this question it to learn good commenting practices through examples provided and rated by the community.
I recommend you read Beautiful Code. It's a great example of what you're after.