Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading Python source code to improve programming skills [closed]

Tags:

python

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 new to programming, I am just trying to improve my skills.

like image 503
killown Avatar asked Aug 31 '10 00:08

killown


4 Answers

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

like image 84
aterrel Avatar answered Nov 20 '22 05:11

aterrel


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.

like image 28
Brian Campbell Avatar answered Nov 20 '22 06:11

Brian Campbell


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. It is really clean Python code.

like image 30
Lou Franco Avatar answered Nov 20 '22 06:11

Lou Franco


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

like image 2
Tool Avatar answered Nov 20 '22 04:11

Tool