Live data from Hacker News

Ask HN: What source code is worth studying?

news.ycombinator.com

101–110 of 176 posts

Re: Ask HN: What source code is worth studying?

#101
Take a look at Redis sometime. You might want to actually work on it a bit to help internalize what you're reading. Here are a couple of articles that might help get you started:

http://pauladamsmith.com/articles/redis-under-the-hood.html

http://www.starkiller.net/2013/05/03/hacking-redis-adding-in...

Re: Ask HN: What source code is worth studying?

#103
It's not great code (though I'm working to make it so), and perhaps not the intent of this question - but if you want to looking at a 25+ year old codebase that's being refactored, check out LibreOffice, especially the VCL component:

http://cgit.freedesktop.org/libreoffice/core/log/vcl/

Re: Ask HN: What source code is worth studying?

#104
Please enjoy the source code of PostgreSQL (any version, but latest is generally recommended) core. It is very well factored, and typically also very well commented. This community cares a great deal about code quality, because they are so clear on the relation between readability, diagnosability, and execution correctness.

Re: Ask HN: What source code is worth studying?

#105

Earlier quoted context omitted.

It's a little hidden: http://pdos.csail.mit.edu/6.824-2013/schedule.html

I meant specifically the "discussions", as mentioned in the 'course information' page: >>> "Please use Piazza to discuss labs, lectures and papers. We will look at Piazza regularly and answer questions (unless one of you answers first); the entire class can see and benefit from these exchanges."

I don't think you'll be able to access these. My university uses Piazza as well and you need a university .edu email address to get access to the Piazza boards.

Fortunately, if the way MIT uses Piazza is anything like the way my school does you aren't missing much. Usually people just use Piazza to clarify something that was glossed over in lecture or to get help on some aspect of the homework.

Re: Ask HN: What source code is worth studying?

#106
post #23

Earlier quoted context omitted.

How long does it usually take to get a reply from Matasano. I have sent a mail couple of days ago, but no reply yet.

Saw tptacek mention the workload yesterday: https://news.ycombinator.com/item?id=7598284 > There are at last count something like twelve thousand people who have reached out to us for our free crypto challenges [...] Every damn one of those people is an email exchange that me, Sean, or Marcin had to have directly, on our own time, with no compensation. I imagine the response time can vary quite a bit.

Maybe the first one or two challenges could be available online, and requests should be accompanied by the answers to those. Maybe that would reduce the volume somewhat.

Re: Ask HN: What source code is worth studying?

#107

Honestly, aside from learning to express a few extremely specific patterns in your language of choice concisely and elegantly and reminding yourself of the existence of certain libraries and utility functions so you don't accidentally waste time reinventing them, I think reading source code is a pretty useless exercise unless you also have a detailed record of how that source code came to exist in its present form. U…

I sort of agree, and sort of disagree.

It is possible to make misteps gracefully - that is, even when making mistakes you can mitigate the problems by writing clean code and trying to make it fit nice patterns you've already seen.

Sure, you can't copy directly, but you can get a feel for what is nice and isn't by looking at lots of code that has reached it's goal, and thus get an intuition for code smells.

Further, seeing how principles and patterns are used elsewhere helps take abstract concepts and turn them into real examples - for me anyway this is vital for my learning of anything.

Re: Ask HN: What source code is worth studying?

#109
post #35

Slight tangent to your question, but one thing I have noticed recently is that having to deal with really crap code inspires me to do my own better. I inherited a colleagues work after she left, and it was horrible. But I thought about why it was horrible, and how to make it better. What would it look like if it was done well? Even with my own code, if I look at something I did 6 months ago, and it doesn't make sense…

It frightens me how my future replacement is probably going to think "gee, that guy was horrible" unless he knows all the historic context and reasons why the code was written the way it was written.

That's the same reason I try to keep my code clean, and comment liberally.

Re: Ask HN: What source code is worth studying?

#110
post #2

C -> Varnish PHP -> Yii Ruby -> Merb Scheme -> Arc Clojure -> Core JavaScript -> Multeor Any languages in particular that you're interested in not covered above?

Thanks for this list. I was mostly looking for Python, Javascript, Haskell and C#. Any help regarding that? Also, as I believe this thread will also help others, you can go ahead and post about any other code-bases for other languages.

For C# i found the disruptor.net code to be very nice. It's mostly a direct port of disruptor from java - but it definitely was pretty nice to read through.
Post reply on HN