Ask HN: Looking for examples of "really great code"?
I would like to use this in a research exercise.
The context is that many companies wish to "examine your code" as part of their recruitment process.
I believe that "examining code" is an extremely poor way of evaluating someone, and that the results of such assessments are extremely subjective and ultimately meaningless.
One of the most effective ways to prove this is to take some code that is widely regarded as being "really great code" and ask various people how they would rate the programmer based on that code. My prediction is that many people will assess this code to be of poor quality.
In an ideal world I'd like to find "generally accepted" "really great code" in a variety of languages, but even one example would be a starting point.
Specifically it would be good to find some of Bill Joy's original TCP/IP implementation code. This unfortunately will only be of limited value however as it's not going to be object oriented, and OO is something that all employers look for these days.
EDIT CLARIFICATION: I'm looking for code that can be specifcally attributed to one individual programmer.
For example it would be good to identify code that is written purely by John Resig, or code that is written purely by James Gosling. I need to be able to attribute all of that code purely to one individual programmer.
22 comments
[ 5.5 ms ] story [ 64.5 ms ] threadhttps://github.com/django/django
https://github.com/git/git/
https://github.com/torvalds/linux
People may disagree on what constitutes great code, but most people reasonably skilled in the art can agree on when code is crappy.
I am expecting this is especially the case where the person assessing the code does not understand what the code does (i.e. a "lesser" programmer assessing the work of a "greater" programmer)
When deciding if code is good or not, surely there should be quantified criteria for assessment. Code cannot be judged to be "good" or "not good" without specific pre defined measures of assessment. I would suggest that close to 0% of employers that want to "see your code" are assessing against pre defined assessment criteria.
A good experience would be get 4 experienced developers to read and evaluate a piece of code; that'd raise some interesting practical aspects of their evaluation of its goodness.
I wouldn't be terribly surprised if "lesser" programmers cannot recognize good code - that's just Dunning-Kruger. That was why I suggested looking for crappy code instead - more people can recognize crappy code, because more people are beyond that skill level. If you ask for samples of good code and your replies all differ in their assessments, you don't know whether that's because "good" code is intrinsically hard to recognize, or because all your respondents were crappy programmers.
1. Most of the code is error checking/handling. This isn't necessarily a good indicator in general, but for C code it is.
2. Consistent style.
3. Functions are static unless otherwise needed.
2 and 3 seem minor, but in my experience, 2 is indicative of someone who pays attention to details and 3 suggests that the person is an experienced C coder.
At 14,998,651 lines of code as of 3.2[1], I'd sure as hell hope not!
[1] http://www.h-online.com/open/features/What-s-new-in-Linux-3-...
http://okmij.org/ftp/ (oleg)
http://www.lua.org/source/5.1/ http://www.lua.org/doc/jucs05.pdf (unsure, but it's either 1 person or small team)
http://svn.python.org/projects/python/trunk/Objects/listobje... http://svn.python.org/projects/python/trunk/Objects/listsort... (tim peters)
http://en.wikipedia.org/wiki/Lions%27_Commentary_on_UNIX_6th... (ok, so lions didn't write the code)
http://www-cs-faculty.stanford.edu/~uno/plain.tex http://www.tug.org/TUGboat/tb16-3/tb48bzyl.pdf (knuth)
[when two links appear on a line the second describes the first]