tags:

views:

157

answers:

7

I am trying improve my programming skills reading other peoples code but I'd like to know what's the best source code to read?

EDIT

I have read some books:

How to Think Like a Computer Scientist.

Learning Python, Fourth Edition.

Expert Python Programming.

Core Python Programming.

I am not a newbie, I am just trying get better programming skills.

A: 

Honestly, I don't think that just reading it will improve if you're a newbie, I'd try actually writing code, hands-on experience is the best method for learning.

Nicholas
And what if you're faced with a problem which you don't know how to solve? Obviously then you will be forced to look at the source (solution) which WILL further teach you problem-solving techniques and probably will improve your way of seeing through problems.
Tool
+5  A: 

I would recommend finding an open source program that seems interesting and start contributing. This would require you to read and understand code well enough to improve it. Most open source hosting sites will let you find projects by what language they are written in. For example Github.

You can also check out the results over at topcoder

aterrel
+2  A: 

Reading, understanding and then applying the methods used by a better coder is the best way to learn coding if you just started.

Tool
What code do you recommend?
S.Lott
+3  A: 

Just reading source won't improve your skills all that much. You might learn a trick here and there, but on the whole, changing the code will teach you far more than reading it ever will.

I would recommend finding an open source project that you like and use, identifying a few bugs that you are interested in fixing (finding bugs should be pretty easy, and if you can't do it yourself, check the bug tracker), and then fix them. Some bugs may be harder to fix than others, which is why I suggest finding a few different bugs; if you get stuck on one, move on to another. You will have read plenty of code in order to find the bug, and you will have thought the code through enough to be able to fix a bug in it. Furthermore, you will have improved a piece of software that you know and use, and if you submit the patch back to the project, you may get good review and criticism on your patch, as well as helping out future users and getting something to stick on your resume.

Brian Campbell
thanks, find an open source project seems what everyone recommends.
killown
A: 

Just reading won't improve your skills but depending on how you learn it can be very helpful until you get a grasp on things.

Open-source projects are your best bet, because they are code that is in use. It may not always be the prettiest, but it's guaranteed to be functional.

Some of the ones I've looked at are Django and Trac by Edgewall. Neither is probably the best, but they do help a little.

There are others that are also widely used, such as Plone (and Zope)

Freddy
+3  A: 

In python, I love Django source code. It isn't going to make sense unless you learn how to use it first, which is probably a good thing to do anyway. Then pick a random thing you want to know more about and read the source. Really clean python.

Lou Franco
A: 

More language agnostic, but when I am trying to learn new languages, techniques or use 3rd party tools/libraries, I like to start with a problem I would like to solve.

For myself, I like to write golf statistic applications, so I have now implemented it in a number of different languages. My code is far from perfect, but I can then work on re-factoring and slowly working in specific patterns and practices for the language of choice.

Reading code isn't bad, but the best thing to do is get your feet wet and code up an application that you are familiar with and that will add value (if even just for yourself).

Edward Leno