Skip to content

Getting started

October 23, 2009

We had our first meeting last night, with 11 people gathering in person and another two or three (we think) following our Ustream channel online.

After the obligatory pizza and soda feast, during which we made sure everyone had downloaded Python 3.1.1 and successfully installed it, we started off with introductions.

It turns out that pretty much all of us have had some tangential interaction with programming at work, and are at least familiar with what code looks like.  One or two had solid programming experience but were new to Python, and several had dabbled in things like HTML/CSS, Ruby, or PHP/MySQL.  About half of us had made at least one false start at learning to code on our own (me included), and were eagerly hoping that this buddy system approach would provide the ongoing motivation necessary to attain whatever level of proficiency we’re each after — enough to write an iPhone app, to DIY instead of paying for a build, or to avoid those situations in which someone tells you something is impossible and you’re unable to prove them wrong.

Personally, my goal in learning to code is to be able to contribute to the swirling pool of innovation: not just my ideas or an introduction between people who should know each other but don’t, but something I made—something I put into action. Specifically, I’d like to be able to contribute to the work of the Sunlight Foundation, since I’ve long admired their efforts to improve data transparency and to further open government.

With these happy thoughts in mind, we dove into the book.

It worked rather well to have everyone reading through the pages and working the examples on their own, each at his or her own pace.  We tended to talk a lot, whether it was to ask each other questions or just to make jokes, and a few small groups tended to form here and there.  I found I really benefitted from having some more experienced folks in the room, since they were able to answer questions like “why isn’t there an ‘else’ statement here?” or “arg! why doesn’t it like my indentation?!”

Instead of starting with the stereotypical “Hello world” exercise, the book had us jump right into building a simple guessing game.  We started with a fixed integer and a conditional statement that would tell the player either “You win!” or “You lose!” depending on whether they input the correct number.  I had fun trying to break it (and succeeding) by guessing “bite me” (which returned a type error).

After that, we improved the game by adding a loop and some more helpful feedback for the player, such as “Too high” and “Too low”.  Finally, we learned to import a random integer so that not even we knew the answer ahead of time.  (Several of us played with different ranges of integers, but 1-20 seemed about the largest we could tolerate without getting bored by the game before we’d finished it.  I would have liked to try spicing it up a little by adding more colorful feedback for certain guesses, but  we had concluded Chapter 1 and we on to bigger and better things.)

Chapter 2 saw us retrieving the price of coffee beans from a dummy website.  The URL from the book wasn’t up yet, so it was a good thing we had some HTML jockeys in the house; Charlie was able to throw up an appropriate page for us to request and read.  We used urllib.request to read the page, then refined it by reading only a substring as defined by offset.  Of course this technique isn’t preferable, so we then further refined things by using .find() to locate the dollar sign and read the desired substring after that.  Adding a loop and employing the float() function then allowed us to monitor the price of coffee until it fell below a desired level.  In order to avoid crashing the server, we then got to learn about the time library.

At this point, most folks had to get going, so we closed down for the evening.  Not everyone ended in the same place, but it seemed clear that we were all following along well and are capable of working independently, so we agreed to be through Chapter 3 by the time we meet again on Monday evening.  Two together, one apart seems like a good chapter pace, and with weekly meetings will get us through the book in about a month.

After that, we’ll probably choose another book to help us get our hands a little deeper into the nitty-gritty of things… suggestions welcome.

Advertisements
3 Comments leave one →
  1. October 24, 2009 4:12 pm

    Hi! Great to see a group of people working through the book and having fun with it. Yes, chapter 2’s Beans-R-Us site is not on-line yet, but we have a test-site at http://beans.itcarlow.ie that can be used in the meantime. (It’s a bit crazy at the moment as the book enters the final stages of preparation).

    Keep having fun… I’ll be keeping an eye each week (lurking) to see how your group is progressing.

    Regards.

    Paul Barry (co-author, Head First Programming).

  2. November 23, 2009 12:30 am

    Wow! You’ve got me motivated to dive into this book. I can’t wait to get my copy! I’ve tried before to jump into Python…and tried again. It sounds like this approach is working for ya’ll! Good luck and thanks for the updates!

Trackbacks

  1. Head First Python? Nope! Head First Programming…with Python 3.0

Leave a Reply

Fill in your details below or click an icon to log in:

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

%d bloggers like this: