Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Studying open-source code brings immediate benefits to your own code. (factore.ca)
25 points by adriand on Feb 16, 2010 | hide | past | favorite | 6 comments



Great example. About a clever technique. And implementing it in the author's own code.

Check out Dr. Spinellis' Code Reading:

"Code reading requires its own set of skills, and the ability to determine which technique to use when is crucial. In this indispensable book, Diomidis Spinellis uses more than 600 real-world examples to show you how to identify good (and bad) code: how to read it, what to look for, and how to use this knowledge to improve your own code.

Fact: If you make a habit of reading good code, you will write better code yourself."

http://www.spinellis.gr/codereading/


Agree, other than books and people, code can be a mentor.

With one _giant_ exception: there are too many bad code out there so be very careful.


There are also tons of good code around. Most large, successful open source projects have source code full of gems from which we can all learn. Even better, by participating to a large open source project we can also learn a lot from the processes used in it.


What I think is important to keep in mind is that reading good open-source code is what helps. I'd make sure a piece of code was written by a fair number of smart people and used by others before I started copying their idioms and emulating their style.


Two kinds of learning, right? Learning by example (e.g. reading books, reading others' code) and learning by doing (e.g. experience building things, writing your own code).

People often do one but forget the other.


I agree 100%. I think it usually comes down to confidence: if you're not confident in your ability, it's all too tempting to try to learn "just a little bit more" and never take the plunge enough to practice. On the other end of the spectrum are the audacious "rock star developer" wannabes.

Skillful programming requires a weird mix of both attitudes.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: