Live data from Hacker News

Ask HN: What source code is worth studying?

news.ycombinator.com

101–110 of 117 posts

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

#101
post #99

Earlier quoted context omitted.

There's no literate source linked to on that page. Just plain, normal, barely-commented C.

"There's no literate source linked to on that page. Just plain, normal, barely-commented C." The book by David Hanson is the literate program.

Ok, so the literate source, in a form that I can actually play with, isn't acutally available. It doesn't even seem to be maintained in literate form in SVN.

That's what I was trying to determine.

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

#102
post #22
post #2

SQLite's source listing is great. I learned a lot about good C practices and documentation reading it.

If you like that style of C code, Tcl's is similar (and it's not a coincidence, as Dr. Hipp is part of the Tcl core team).

Thanks for the tip, I didn't know that. I haven't ever used Tcl besides some tinkering a few years ago, whereas SQLite is used incredibly often, but I'll read any C that's well written.

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

#104

Any recommendations for php? I wrote a php/mysql web application for SaaS customers. I am looking at ways to improve performance/cache/error handling or simply write a better code.

For a smallish project that you can figure out fairly easily, I recommend the Kohana framework. It's extremely well documented and it's quite easy to read. Many people actually recommend reading its source to supplement the documentation and after having to do so myself I can see why.

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

#105
post #95

Earlier quoted context omitted.

I spent several years writing drivers for NT and I don't know which part of the NT kernel you were looking at. The parts I saw were an utter mess lacking any sort of elegance whatsoever. If there were two ways to implement something, one simple and the other one contrived, you can bet your MCSD certificate NT will be using the latter. The overall impression was that it was hacked together in the worst sense of the wo…

I'm not sure you can actually see the kernel outside the base OS team at Microsoft, or under a unique license. it is not included in MSDN or the DDK. Having worked on that team and having seen it for myself, it is truly elegant, concise, and very well written. I myself never touched it, and that is for the best. I probably wrote some of the crappy drivers for which you hold so much contempt.

You can get the Windows Research Kernel through the MSDNAA (which most major universities should be hooked up to). The WRK has all the good stuff

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

#106
post #31

One project I found fascinating reading a while back when I was working on graphics, is AGG. It's a vector graphics toolkit, a bit like Cairo, Quartz 2D or Java 2D. It uses a particular style of C++ - a mixture of template programming together with regular polymorphism - to build up a collection of rendering components. The components are almost Unix-like - you plug them together to build your customized rendering pi…

http://www.haiku-os.org/documents/dev/painter_and_how_agg_wo...

http://bit.ly/131cxL (.doc file)

those help. if you can figure out the source code without the documentation at the agg site + those files, more power to you. but basically you are nuts.

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

#107

Could anyone recommend something for Python? If something is out there for ruby, there's got to be at least one thing for python.

How about Ned Batchelder's implementation of Frank Liang's hyphenation algorithm:

http://nedbatchelder.com/code/modules/hyphenate.html

or AI:

http://aima.cs.berkeley.edu/python/readme.html

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

#108
post #37

Any recommendations for Ruby/Rails projects?

I'm a big fan of ThoughtBot's stuff (http://www.thoughtbot.com/projects). Mostly I use Shoulda and FactoryGirl, but I've been consistently impressed with their ideas and code quality.

For idiomatic Ruby and Rails stuff I have probably learned more from Rick Olson's stuff (http://github.com/technoweenie/) than any other single source. Sometimes I think he tends to be too clever for his own good, but the code is good to read for that reason even if simpler things are better in production.

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

#110
post #68

Anyone can point to a good javascript code?

I find the sources of ExtJS nice to read. They have an OOP approach.

I'd really like to see some functional-style JS code.

[ background : I've used OOP a lot, and thought it was the ultimate, until I discovered lisp... ]

Post reply on HN