Live data from Hacker News

Ask HN: What code have you read recently?

news.ycombinator.com

1–10 of 40 posts

Re: Ask HN: What code have you read recently?

#2
I had a look at the Haskell Prelude code: http://www.haskell.org/onlinereport/standard-prelude.html

Lots of good code in there, especially in regard of simplicity and beauty. If you're diving into functional programming, be sure to have a look at it, even if you're a beginner like I am.

Re: Ask HN: What code have you read recently?

#3
Aside from the spaghetti code that my predecessor wrote, I've been reading a book called "Clean Code: A Handbook of Agile Software Craftsmanship" by Robert C. Martin. The code in the book isn't always interesting for content, but rather for style and craft. He does a great job explaining industry best practices, along with How and Why they are used.

Re: Ask HN: What code have you read recently?

#7
I have been reading the R base library code, mainly to understand the graphics functions. I'm amazed how simple and ordinary it looks. I have never worked on a big software project and it's exciting for me to see how something powerful is built from small chunks here and there.

Last year I spent some time reading the arc source code. It was a lot of fun. I didn't know any Lisp, so the recursions and macros were hard for me to get my head around, but it was amazing to realise that this site is built on some small core concepts which can be grokked if you spare the time.

I loved Douglas Crockford's book Javascript: The Good Parts. Again, I couldn't understand all of it but it gave me a good feel for well-written Javascript code.

Re: Ask HN: What code have you read recently?

#10
I've been reading some BSD userland source (awk, sed, trek, and OpenBSD's netcat) parts of Lua and OCaml's VMs, Redis, and Joy. Awk and Lua's source are particularly good, IMHO.

The code that had the biggest impact on me lately was the original J interpreter, though: http://nsl.com/papers/origins.htm . It looks like some sort of crazy brainfuck-ish thing, but it's not a joke. I highly recommend printing it out and trying to get in Arthur Whitney's head. (But if you run it, it will probably just segfault. It's rather cavalier with nonportable function pointer casting. It's prototype code from 20 years ago. If you want a working version, look at J (http://jsoftware.com) or Q (http://kx.com).)

Post reply on HN