HACKER Q&A
📣 beanders

Beautiful Code


Architects, for example, can name their favorite structures and likely discuss them at length. Can software engineers do the same?

Provide examples your favorite pieces of code throughout history, any language.

Code can be aesthetic in many ways, I don’t intend to limit responses to any particular metric. Whatever floats your boat. Bonus points for explaining what you like about it.


  👤 smt88 Accepted Answer ✓
I once wrote a web service that I deployed and then never had to maintain. I still have not discovered any bugs in it, and it has not needed any new features. It's still running now and has thousands of users a day.

That code is beautiful because I never have to look at it or tinker with it.

(For those wondering about security, it is deployed in containers that are destroyed and rebuilt from patched images on a daily basis. It does not use any web-hosted libraries.)


👤 Turing_Machine
The original John McCarthy "Maxwell's Equations of Software" in Lisp.

Pretty much any code or pseudocode written by Donald Knuth.


👤 daly
Lisp in Small Pieces

Physically Based Rendering

Both books are outstanding examples of readable literate programs.


👤 pestatije
Hello world! is beautiful. And yeah, any language.