I believe the point of examining code is usually to eliminate "really crappy code", it's not to determine "really great code". The code sample is usually a qualifying factor, not a determining one.
People may disagree on what constitutes great code, but most people reasonably skilled in the art can agree on when code is crappy.
I don't agree. My assertion is that person X might think a code sample is crappy, but person Y will not think it is crappy code.
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)
Your original assertion was that person X might think a code sample is good, but person Y will not think it is good. Those are two different assertions - you need to test them independently if you want to draw conclusions.
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.
Interesting thought. This is the heart of my argument. "Good code is common sense" makes me wonder where is the science in deciding if code is good or not.
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.
Well, scientific metrics of code quality may be more related to software design than the code craftsmanship itself.
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.
People may disagree on what constitutes great code, but most people reasonably skilled in the art can agree on when code is crappy.