News for hackers. Stuff that matters.
Re:Learn to read the source, Luke by greenyoda on Monday April 16, 2012 @05:33PM (#3849569)
Atwood wrote: "The idea that you'd settle down in a deep leather chair with your smoking jacket and a snifter of brandy for a fine evening of reading through someone else's code is absurd."

Not so absurd, really. Reading well-written source code is a great way to learn the finer points of the art of programming; it's not just for fixing bugs. In fact, entire books have been published that consist of annotated source code, the most famous probably being Lions' Commentary on Unix and Knuth's "TeX: The Program".

Re:Learn to read the source, Luke by enobrev on Tuesday April 17, 2012 @04:26AM (#3851728)
The hard part is finding the "well-written source code". Sure there are plenty that have been battle-tested for years, which we can refer to, but every day we come across tens to hundreds of github links. Some are legible. Some are clever but maybe interesting. Some are in need of serious refactoring. Some are first-attempts. Some are "drunken rants" (usually < 10 checkins, with every file marked as 6+ months ago). And once in a great while, some are worth some serious attention.

I "grew up" in PHP, and while the majority of the open source code I've read has been difficult to parse, at best, I've read some amazing code. Most from intelligent peers for whom I still hold a deep respect.

It's what has kept me inspired. It's what brought me to eventually appreciate Javascript (server and browser), Actionscript (3), Java, Python, C, Ruby, a few others, most recently including Clojure. And when it comes to amazing code (regardless of language), I will gladly sit and read with more intrigue than the best fiction has to offer.

It's the massive amount of mediocre or less that defines the divide making source code painful. I skim a lot. I look for whitespace, the occasional well-written comment block, proper variable / method naming, things to hint that this was written to be read by another human who likes to read, and from there I dig in deeper with the hopes that I have something worth reading.

That is to say, I LOVE to read code, but it can be difficult to find the code worthy of the smoking jacket and voting-age scotch.

Re:Learn to read the source, Luke by kevinpet on Monday April 16, 2012 @06:27PM (#3849819)
Entire books have been published that consist of annotated source code, the least famous probably being Lions' Commentary on Unix and Knuth's "TeX: The Program", since they are pretty much the only widely distributed books consisting primarily of annotated source.
Re:Learn to read the source, Luke by gjm11 on Tuesday April 17, 2012 @05:39AM (#3851890)
I have at least three others on my bookshelves. (Two Knuths -- METAFONT and the Stanford GraphBase -- and Fraser&Henson's "A retargetable C compiler".)

For sure, there aren't a large number of books with this structure. So what?

Re:Learn to read the source, Luke by abecedarius on Monday April 16, 2012 @09:12PM (#3850452)
Re:Learn to read the source, Luke by michael_dorfman on Tuesday April 17, 2012 @03:33AM (#3851606)
Just glancing over at my bookshelf, how about Tanenbaum's OSDI and Knuth's MMIXware?
Re:Learn to read the source, Luke by Danieru on Monday April 16, 2012 @07:37PM (#3850085)
How can they be the least famous if they are the only ones?
Re:Learn to read the source, Luke by TeMPOraL on Monday April 16, 2012 @07:54PM (#3850142)
If they're the only ones, then they're the least famous and the most famous at the same time.
Re:Learn to read the source, Luke by cgag on Monday April 16, 2012 @07:45PM (#3850110)
In the same way they're the most famous.
Re:Learn to read the source, Luke by haberman on Monday April 16, 2012 @07:01PM (#3849958)
Yeah, I do this frequently with the source code to Lua, which is an astonishing piece of software engineering that constantly inspires me. I can hardly think of another open source project that does so much with so little code.
Re:Learn to read the source, Luke by astrodust on Monday April 16, 2012 @09:04PM (#3850417)
I'm sure I'm not the only one that wants a good tool that would convert arbitrary source-code to Lulu-sized PDFs that could be printed on demand.
Re:Learn to read the source, Luke by rkuester on Tuesday April 17, 2012 @04:52AM (#3851781)
Try the command line program "enscript". It has many options that control the output formatting. For example, you can print pages in landscape orientation, two-up, with source highlighting and line numbers.
Re:Learn to read the source, Luke by akx on Tuesday April 17, 2012 @07:20PM (#3855556)
If you also want coloring (I know I would), Pygments - http://pygments.org/ - outputs PDF via LaTeX.
Re:Learn to read the source, Luke by andrewflnr on Monday April 16, 2012 @07:01PM (#3849955)
Yes, it's educational, but generally not entertaining or relaxing, as is implied by the scenario of settling down in a comfy chair, etc. If code is entertaining, it's probably not the kind of code to learn good habits from.