04.08.2014 Views

o_18ufhmfmq19t513t3lgmn5l1qa8a.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 19<br />

■ ■ ■<br />

Playful Programming<br />

By now you should have a clearer picture of how Python works than when you started. Now<br />

the rubber hits the road, so to speak, and in the next ten chapters you put your newfound skills<br />

to work. Each chapter contains a single do-it-yourself project with lots of room for experimentation,<br />

while at the same time giving you the necessary tools to implement a solution.<br />

In this chapter, I give you some general guidelines for programming in Python, as well as a<br />

short description of how the projects are laid out.<br />

Why Playful?<br />

I think one of the strengths of Python is that it makes programming fun—for me, anyway. It’s<br />

much easier to be productive when you’re having fun; and one of the fun things about Python<br />

is that it allows you to be very productive. It’s a positive feedback loop, and you get far too few<br />

of those in life.<br />

The expression Playful Programming is one I invented as a less extreme version of Extreme<br />

Programming, or XP.<br />

■Note Extreme Programming is an approach to software development created by Kent Beck. For more<br />

information, see http://www.extremeprogramming.org.<br />

I like many of the ideas of the XP movement but have been too lazy to commit completely<br />

to their principles. Instead, I’ve picked up a few things, and combined them with what I feel is<br />

a natural way of developing programs in Python.<br />

The Ju-Jitsu of Programming<br />

You have perhaps heard of ju-jitsu? It’s a Japanese martial art, which, like its descendants judo<br />

and aikido, focuses on flexibility of response, or “bending instead of breaking.” Instead of trying to<br />

impose your preplanned moves on an opponent, you go with the flow, using your opponent’s<br />

movements against him or her. This way (in theory) you can beat an opponent who is bigger,<br />

meaner, and stronger than you.<br />

381

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!