News for hackers. Stuff that matters.
Re:To Develop Expertise, Motivation is Necessary but Insuffi... by samvelst on Sunday November 27, 2011 @01:08AM (#3281843)
"For chess, deliberate practice includes deep analysis of grandmaster games."

If this is true, could studying (reading) good code do the same for programming? One could, for example, begin to write an application and find code to a similar application where they would be able to check why things are implemented a the way they are as they go along. The tricky part here is deciding which code is worth studying.

Re:To Develop Expertise, Motivation is Necessary but Insuffi... by nandemo on Sunday November 27, 2011 @09:42AM (#3282477)
I believe "read good code" is already standard advice for improving your coding skills. However, I think there are many differences compared to studying chess by analysing games.

One way that it works for programming is doing small exercises and then checking the answers. For instance, the 99 Problems in Prolog (or its translations to Lisp, Haskell, etc):

http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/func...

But as you say, for larger problems it's harder to find good "answers". Even for something relatively small like unix utilities. Say you want to write cat or echo. You get source code from BSD and GNU and Solaris and they're quite different from each other (I recall seeing a comparison somewhere, mainly putting the GNU code in bad light, perhaps unfairly. Anyone has the link?).

Re:To Develop Expertise, Motivation is Necessary but Insuffi... by abecedarius on Sunday November 27, 2011 @02:03AM (#3281912)
This is why I haven't yet read all of Peter Norvig's coding essays -- you can depend on him to publish code that's really hard to improve on (by the metrics he's writing for, like clarity). I like to write my own first before reading someone else's, because yes, it really does help you suck the juice out of a learning opportunity. Feynman and Turing both seem to have emphasized this too.

Really polished code is hard to find. I've been playing around off and on with Ken Thompson's regular expression search paper most recently.

Re:To Develop Expertise, Motivation is Necessary but Insuffi... by DamagedProperty on Sunday November 27, 2011 @09:19AM (#3282437)
I feel that the end result of polished code isn't useful unless you can see the process they went through to get there. It seems difficult to retrace their footsteps.
Re:To Develop Expertise, Motivation is Necessary but Insuffi... by abecedarius on Sunday November 27, 2011 @03:40PM (#3283346)
I've found that extra info to be interesting and useful, it's true, when I can get it. For instance, Norvig's Lisp-in-Python essays came out with the code still in some flux and I could compare his improvements to mine.
Re:To Develop Expertise, Motivation is Necessary but Insuffi... by Fliko on Sunday November 27, 2011 @01:41PM (#3283015)
It might be even more beneficial to read good code then try to find a way that it could've been done better.
Re:To Develop Expertise, Motivation is Necessary but Insuffi... by abecedarius on Sunday November 27, 2011 @03:46PM (#3283359)
Part of the same process, yeah.