What is your "nightstand" code?
Ask HN: The most fun and beautiful code you know of?
1–10 of 23 posts
Re: Ask HN: The most fun and beautiful code you know of?
#2(Not because it's perfect and beautiful, but just because I wrote it and understand it.)
Re: Ask HN: The most fun and beautiful code you know of?
#3Not because it's direct computer code, but because when I'm reading it past code i've written starts swirling in my head. Sort of one of those "ahhh fantastic" moments.
Re: Ask HN: The most fun and beautiful code you know of?
#4Re: Ask HN: The most fun and beautiful code you know of?
#5Re: Ask HN: The most fun and beautiful code you know of?
#6- Some bits of On Lisp
- Haskell's SYB and Parsec libraries
- MINIX (2; have yet to play with 3)
Re: Ask HN: The most fun and beautiful code you know of?
#7I only read the first and the third essay, but I must say, wow!
The third essay, for instance, takes a simple 12 line implementation of quicksort in C (which is already quite beautiful), and through a series of well explained transformations, arrives at a four line proof (as in, it's C code that is equivalent to the recurrence relation, and eventually the summation, we all solved in our CS classes) of the average case complexity (~1.4nlgn comparisons) of the quicksort he started with.
That is what I would consider "nightstand" code, or at least a nightstand essay about code. It was actually entertaining, to the point that you don't realize you are solving a recurrence relation in C form until the end, when the parallel becomes obvious.
I only had a chance to skim the other topics, but I'm actually considering buying it, because it really was a blast to read.
Re: Ask HN: The most fun and beautiful code you know of?
#8http://en.wikipedia.org/wiki/Shakespeare_(programming_langua...
Re: Ask HN: The most fun and beautiful code you know of?
#9http://en.wikipedia.org/wiki/Shakespeare_(programming_langua...
Re: Ask HN: The most fun and beautiful code you know of?
#10My own code... (Not because it's perfect and beautiful, but just because I wrote it and understand it.)