Live data from Hacker News

Ask HN: What source code is worth studying?

news.ycombinator.com

71–80 of 176 posts

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

#72
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. Until there is some revolutionary new tool for generating a human-understandable narrated history of large-scale design decisions from a source control history, your time will almost certainly be better spent reading textbooks that incrementally develop a piece of software over several chapters. Even that is cheating -- the authors know exactly where they want to end up and they won't include all the missteps they made when they first started writing similar programs. But it's still loads better than the alternative. Just as sitting in a law school library absorbing an encyclopedic knowledge of the law won't really train you to make arguments that will fly in front of a judge, reading a code base as a dead, unchanging document won't teach you what it is to live in that code.

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

#73
post #68

Earlier quoted context omitted.

In my experience, best jobs you get aren't posted — as best candidates don't send out resumes.

But we can't all be the best.

Not at first. But work with people you like and respect, and learn from them. Then ask them when looking for your next job.

Any place worth working isn't looking for the absolute best candidate for X at any cost. A good fit with someone with a good work ethic who wants to learn always works out better than just raw expertise. And a reference from someone you both respect is the fastest most reliable place to find them.

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

#75

Earlier quoted context omitted.

>>> http://pdos.csail.mit.edu/6.824-2013/ Do each lab. Read the discussion and rtm's course notes. How to read the discussions? I think it's not publicly available. Btw, thanks a lot for the great post.

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

I wish video lectures of these were available...

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

#77

Earlier quoted context omitted.

>Do not identify yourself as "an X programmer," or as anything else. Yet every single programming job post these days is basically looking for someone with X years of experience in a long enumeration of specific technologies. The usual reason being "They need to be productive. Now."

In my experience, best jobs you get aren't posted — as best candidates don't send out resumes.

In my experience, networking plays a huge role in landing a good job. Replying to job posts should be a last resort.

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

#78
post #68

Earlier quoted context omitted.

But we can't all be the best.

Not at first. But work with people you like and respect, and learn from them. Then ask them when looking for your next job. Any place worth working isn't looking for the absolute best candidate for X at any cost. A good fit with someone with a good work ethic who wants to learn always works out better than just raw expertise. And a reference from someone you both respect is the fastest most reliable place to find the…

> Any place worth working isn't looking for the absolute best candidate for X at any cost

That's so true. If they absolutely need the best candidate, they are about to run a very risky project.

Good management means, among others, to ensure that new people have the opportunity to learn and to "get into" the project. If management requires the "best" developers, it really means that the management is bad and the developers are supposed to make up for that.

(Having said that, there are also people who are simply a sunken cost. That is, managing them requires more resources than the value they produce. However, that's the other end of the scale, and a separate topic.)

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

#80

== Vim or Emacs == Just pick one and force yourself to use it to the exclusion of other editors. Future you will thank you later, because you'll still be using it 20 years from now. "We are typists first, programmers second" comes to mind. You need to be able to move chunks of code around, substitute things with regexes, use marks, use editor macros, etc. == 6.824: Distributed Systems == http://pdos.csail.mit.edu/6.8…

> == Tarsnap ==

> How to write C. Study the "meta," that is, the choice of how the

> codebase is structured and the ruthless attention to detail. Pay

> attention to how functions are commented, both in the body of the

> function and in the prototypes.

I just had another look at the tarsnap source code, and while I know Percival is a great guy, and I can't imagine him suing over "mis-use", the bulk of the code is under a pretty restrictive lisence:

"Redistribution and use in source and binary forms, without modification, is permitted for the sole purpose of using the "tarsnap" backup service provided by Colin Percival."

That is, except the code under "libcperciva" which appears to be under a traditional 2-clause BSD license.

So, for example using the bsdtar.c file to teach yourself how to handle command line arguments might be a bit dicey, as it's entirely unclear which part of that file is under the BSD license, and which part you're not allowed to distribute.

It's one of the reasons why I'd which Percival made the entire thing available under a dual license (eg: BSD) and simply required people to use the official client for the tarsnap service.

Then again, I'm not used to audit closed source software, and therefore probably extra scared of what might happen if I accidentially learn something from reading said source... ;-)

On the other hand, Percival does publish quite a lot of stuff that's [ed: entirely free], such as spiped https://www.tarsnap.com/spiped.html .

Post reply on HN