tags:

views:

408

answers:

5

EDITED ALL GREAT COMMENTS - THANK YOU

I started with c++ but as we all know, c++ is a monster. I still have to take it and I do like C++ (it takes programming a step further)

However, currently I have been working with python for a while. I see how you guys can turn some long algorithm into simple one.

I know programming is a progress, and can take up to years of experience. I also know myself - I am not a natural programmer, and software engineering is not my first choice anyway. However, I would like to do heavy programming on my own, and create projects.

How can I become a better python programmer?

Thank you.

+15  A: 
The MYYN
the exercise link is broken, most people would downvote because its easier to click the down arrow oppose to take some time to write the comment
Anthony Forloney
@aforloney: I believe that most SO users are conscious enough to prefer to write a comment before downvoting.
kgiannakakis
lol thanks guys. i never downvote anyone (and I don't see any point except for spammers) These are great resources, I will check them out once finals are over!!!
JohnWong
Make sure you mark this answer as correct if you're satisfied.
Goose Bumper
+1 Read code, gotta trump up the read code bit more. Especially since python's stl is available to read through. Oh and Woa! Slott wrote a book!
Silfheed
+4  A: 

Read code. This will help you learn what works well in Python and what doesn't. As part of this, learn python idioms and the standard library.

Some examples of literature to read:

As for the algorithm part you mention, some specific parts of the standard library to learn include:

  • itertools
  • functools
  • contextlib
Ed
great. once finals are over i will check them out
JohnWong
+3  A: 

The already-posted answers are great.

In addition, whenever you're coding something in Python and you start doing something that feels clumsy, take a step back and think. If you can't think of a more elegant way to do it, post it as a question on Stack Overflow. I can't count the number of times that I've seen someone reduce ten lines of Python into one (which is still perfectly easy to read and understand).

jboxer
rofl but in real world application (let's jump all the way to Google), is it better to reduce 10 lines into one (if there is no change in performance)?
JohnWong
Absolutely, as long as that 1 line is still easy to read. Concise and understandable code goes an extremely long way towards an easy-to-maintain system.
jboxer
+2  A: 

One suggestion is to find an open-source project in Python, and start contributing. You may ask "how can I contribute, if I'm a beginner?". One answer is "write tests". Almost any project will welcome you as a tester. Another answer is "documentation", though that is less likely to give immediate benefits.

Michael Easter
I haven't thought about that! Thanks.
JohnWong
any recommendation for any open source project written in python? Thanks
JohnWong
see this question: http://stackoverflow.com/questions/117561/what-are-good-open-source-projects-in-python-for-which-i-can-be-a-contributor
Michael Easter
+2  A: 

in addition to suggestions pointed by "The MYYN" I would suggest use of pylint

DrFalk3n
wooo i can use this tool after finals and start looking at my old codes :) thanks brother
JohnWong
maybe you should purchase an up vote! :-) brother
DrFalk3n