Monday, August 31, 2009

Interesting, Ayman...

I really enjoyed Ayman Hourieh's latest post, Python Debugging Techniques.  As a self-proclaimed Python up-and-comer, it is good for me to break out of the bad habits I seem to get into every time I start learning a language.  It's not that I'm lazy, per se, it's that when I really get into a program or problem, I don't really want to stop and think about the most efficient way to set up debugging. 
alert(debugMsg);
was quick and dirty when I was learning Javascript,
cout << debugMsg << endl;
for C++, and until reading that post, having
print debugMsg
statements scattered about my python programs were the extent of my debugging helpers.

Immediately after reading his post, I incorporated file logging into my current python project, a data parser for a Physics student friend of mine.  I had originally written his application in C#, and a couple weeks ago he came and asked for a couple new features.  I was in a pickle, as I don't even have a copy of Visual Studio installed anymore, and in fact don't even have a full-fledged Windows machine running anymore (only VM's).  I decided to use my newfound python chops to rewrite his program.  In an hour, I had a functional replica of the program, a program that took at least twice that in C#.   The last few days I have been going back to it occasionally, adding more features, error handling, etc, all in the hopes of making it a bit more robust.

I am excited to put some of these wonderful debugging tools to work tomorrow, and will keep this page updated.

In the works:
  • A WxWidgets GUI for the batch image resizing program I wrote a while back
  • I plan on redoing my genetic algorithm implementation in a more functional style...map(), filter(), and reduce() are going to be my friends...

No comments:

Post a Comment