March 15, 2008

Learning Python

Filed under: dev, education, python — michaelangela @ 7:41 am

I learn by trial and error. I learn through experimentation. That can take you a long way. But Python is a language that gives you this feeling that… ‘there is a better way’. That feeling comes up whenever code doesn’t look good. And by that I mean if it doesn’t have a certain positive aesthetic about it, you kind of know somewhere in the back of your mind, it’s not right. Not wrong, mind you, because it may work. But it just doesn’t “feel right”.

So the challenge is to learn to think in the language. Like learning any language, that takes time, lots of exposure, and… trial and error. Exposure to code that helps you “see”, much the same way when you are immersed in a foreign culture (Chinese for me) that helps you “hear” in a way you haven’t heard before. Then you can think in that new way.

With that, here is an example of code that wasn’t meant to be “clean and pythonic pretty”, but was changed by the author to be pythonic. I am always learning and there were more than a few “aha!” and “ooooh!” while reading the redone version.

Why Python programmers should learn Python


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: