News for hackers. Stuff that matters.
Re:"My current theory is that programming is quite literally... by 6ren on Wednesday June 08, 2011 @09:01AM (#2632908)
So what's good example code?

Sadly (and tellingly) it's not necessarily the most successful code (success comes from meeting user needs, not from good code), but how else can you judge it, apart from reading it. This is made worse because it's hard to tell if code is necessarily complex without understanding the problem it solves, which may be complex. Further, if you don't yet know what good code is, how can you recognize it? Of course, if you are intelligent and reflective and try ideas out, you can learn from both code and bad - it's all raw material, grist for the mill.

IMHO the hard part of programming is understanding the problem to be solved. The solving is easy.

Re:"My current theory is that programming is quite literally... by dchest on Wednesday June 08, 2011 @09:16AM (#2632950)
Sadly (and tellingly) it's not necessarily the most successful code (success comes from meeting user needs, not from good code), but how else can you judge it, apart from reading it.

Schools have suggested reading lists. Do they have the same for code reading?

Fortunately, on the Internet, we have experienced people to help us: http://www.hnsearch.com/search#request/all&q=%22good+cod...

Re:"My current theory is that programming is quite literally... by cturner on Wednesday June 08, 2011 @09:57AM (#2633096)
Interesting. You could teach blocks of code in a similar manner to the way poetry is taught.

"Why did the author do this?"

"What effect do you get when reading this block?"

Re:"My current theory is that programming is quite literally... by 6ren on Wednesday June 08, 2011 @09:22AM (#2632967)
> [suggested code reading lists]

That's a good idea, but I haven't heard of one. I think the best thing is just to read a lot of code, good and bad.

BTW did you check the result of that search?

Re:"My current theory is that programming is quite literally... by dchest on Wednesday June 08, 2011 @09:31AM (#2632997)
BTW did you check the result of that search?

Haha, just skimmed through it, sorry. I remember threads on this topic, but it seems like HN search for this request failed to find them.

Re:"My current theory is that programming is quite literally... by lurker14 on Wednesday June 08, 2011 @12:30PM (#2633794)
Re:"My current theory is that programming is quite literally... by silentbicycle on Wednesday June 08, 2011 @01:07PM (#2633992)
I usually recommend the source to Lua, SQLite, and the BSD userland utilities (grep, awk, etc.). For C, at least.