I’ve never been one for debuggers, I’m too lazy really and because I’ve been a web application developer all these years, debuggers aren’t really very often found. I’m much happier just slapping a print statement or two into the code. But I may have found a way to use a debugger that suits my (primitive) working style.
First of all, it’s worth showing just how easy it is to get started with my debugger, pdb. Add these lines to any stretch of Python.
import pdb
pdb.set_trace()
When the interpreter runs into pdb.set_trace(), it’ll drop into the pdb prompt and you can start inspecting the innards of your code. See the pdb command documentation for everything you can do.
Use test cases to debug web apps
A simple trick for making use of the debugger in a web application is to use a test case as the container instead of the web server. In Django’s testing framework for example, tests are run inside the standard Python unittest module which works happily with pdb.
You can also set IPython to invoke pdb whenever an exception is raised and not caught. Allowing you to debug as you play with your code in a interactive Python session.
At the risk of only posting other people’s buttons, here’s one for A List Apart’s Web Design Survey.

ALA make the valid point that little is known about web designers and developers as a group. Much is assumed, we’re all nerdy young white males, of course! I for one look forward to the results.
Completing the survey gave me a chance to reflect on my 6-7 year career so far and consider it in context. I’ve been very lucky, web design has been good to me in many ways. It’s allowed me to be flexible about where I work, when and with whom. I’m constantly improving my skillset (I ticked the box for every competency in the survey). I’ve been able to play businessman in start-ups, entertaining my own ideas. Although that has sometimes been high-stress and low-income, I’ve managed to find real jobs to fall back on when the going has got too tough.
Right now I’m involved in not one but two exciting start-ups (MyMart, moblogUK) and although it’s a lot of work, they’re both deeply interesting ventures. Reading TechCrunch and other sites the temptation to feel like an also-ran can be a bit strong sometimes. It’s hard to watch lots of great services created by people younger than me spin-out for huge money. That’s like holding yourself up against Hollywood stars or great statesmen and feeling like a failure. I need to remind myself not to do it and concentrate on just making great web applications.
P.S. My most recent act in this quest was to redesign the moblogUK home page and create a new theme for the site. We’ve launched some great new features (including one that is genuine bonafide innovative - busyness).
Cool new thing!
Grep (well, GNU grep at least) has a --colour argument. Add --colour=always to your $GREP_OPTIONS and the matching word will be coloured red in output. Especially useful when grepping multiple files, great for scanability.