Skip to content

Comment on Ask HN: The most fun and beautiful code you know of?

Comments

Anything that:

* Doesn't repeat itself. This includes languages which involve marking out blocks of code once for the interpreter and the second time for humans.

* Is short, because it doesn't reinvent common modules, and modularizes out general logic.

* Uses descriptive names, including using dictionary keys rather than vague list element numbers. A good test is if you can show the code to someone who doesn't work in computing and have them understand it. ZS had a talk on this where he showed lawyers SOx code and received feedback on the rules, changes to the order, etc.

* Uses tree structures for tree structured data (eg, etrees and xpath) rather than treating such data as strings and using RegExs.

* Has docstrings.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.