Live data from Hacker News

Code which every programmer must read before dying

news.ycombinator.com

11–20 of 38 posts

Re: Code which every programmer must read before dying

#11
post #4

SQLite probably has some of the cleanest and most elegant C you will ever see: http://www.sqlite.org/sqlite-src-3070602.zip

I won't argue about code quality of SQLite, because I know it's superb, but the coding style is just horrible. Take a look at anything in OpenBSD (ex: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/bgpd/bgpd... ) or nginx ( http://nginx.org/download/nginx-1.0.0.tar.gz ).

> but the coding style is just horrible.

I had to go look. I agree; there are some things done consistently in the code that are high on my nitpick "don't do that" list. Ugh. I'd have to reformat to work on it, then format to whatever standard they use on checkin, I think.

Re: Code which every programmer must read before dying

#12
post #7

I think a very good example of when OOP is genuinely useful and desirable is the Twisted Networking Engine: http://twistedmatrix.com/trac/browser/trunk/twisted

Crikey, that's like recommending the Bourne Shell (which was a bunch of macros so you could write ALGOL-like code in C)! http://en.wikipedia.org/wiki/Bourne_shell#Quotes

twisted is, well, twisted. And that's what it does to your head too.

Re: Code which every programmer must read before dying

#13
Literate programming is the style of programming that's intended to be read: http://www.literateprogramming.com/

Quite the contrast with the Bourne Shell: "Nobody really knows what the Bourne shell's grammar is. Even examination of the source code is little help." – Tom Duff http://en.wikipedia.org/wiki/Bourne_shell#Quotes

Re: Code which every programmer must read before dying

#14
The Linux kernel. If you look at it really closely it isn't so pretty, but its massive size and overall complexity for me (as an undergraduate) was like looking into the grand canyon. What's more impressive is the speed at which things change and that despite breaking all of the traditional rules for "good" software design practices...it works amazingly well.

Re: Code which every programmer must read before dying

#15

The Linux kernel. If you look at it really closely it isn't so pretty, but its massive size and overall complexity for me (as an undergraduate) was like looking into the grand canyon. What's more impressive is the speed at which things change and that despite breaking all of the traditional rules for "good" software design practices...it works amazingly well.

I haven't seen the whole of it, but it's not ugly and doesn't break all the rules of good design.

Re: Code which every programmer must read before dying

#16
post #7

I think a very good example of when OOP is genuinely useful and desirable is the Twisted Networking Engine: http://twistedmatrix.com/trac/browser/trunk/twisted

Crikey, that's like recommending the Bourne Shell (which was a bunch of macros so you could write ALGOL-like code in C)! http://en.wikipedia.org/wiki/Bourne_shell#Quotes twisted is, well, twisted. And that's what it does to your head too.

Just to clarify, I'm not talking about event-driven programming, errbacks and callbacks, but rather how they've done all of the abstraction of the different protocols and subsystems. It's one of the few times where I've considered inheritance absolutely essential.

Re: Code which every programmer must read before dying

#17

Literate programming is the style of programming that's intended to be read: http://www.literateprogramming.com/ Quite the contrast with the Bourne Shell: "Nobody really knows what the Bourne shell's grammar is. Even examination of the source code is little help." – Tom Duff http://en.wikipedia.org/wiki/Bourne_shell#Quotes

[deleted]
Post reply on HN