It's very important to try to inculcate into children moral rules, such as "do as you would be done by. "
Each routine you read turns out to be pretty much what you expected. You can call it beautiful code when the code also makes it look like the language was made for the problem.