Author Archive
Why I’ve fallen in love with Python
by Seth on Jul.27, 2009, under F/OSS, Python
In a previous post, I briefly mentioned falling in love with Python. Now that I’m finally using Python for a large percentage of my development and am more than “casually acquainted” with its toolset, I thought it would be fun to highlight a few reasons why Python has become my new language of choice.
In an effort to help you understand where I’m coming from, let me (briefly) rehash some of my programming history: I spent much of the 90′s doing dynamic web development using Perl (weren’t those the days!). I eventually migrated to PHP which usually made things much easier on the web; and subsequently replaced most of my console scripting with BASH [shell scripting]. However, I’m kind of a hack and love languages so I have occasionally been known to write something in C; and although I’m not a complete stranger to Java and Ruby, I never really felt like I “clicked” with either of those languages.
Ok, now that I’ve hopefully convinced you that I’m not just a fly-by-night programmer, let me show you some Python code. Brace yourself, as this article is bound to get lengthy… (continue reading…)
Making TurboGears and Authorize.net play nice together
by Seth on Jul.18, 2009, under Python, Web Development
I recently had to wire up an Authorize.net form for a TurboGears project I’m building, and since I’m a bit new to custom form validation in TG I had quite a bit of trouble figuring out the “right” way to do it.
The goal was to get the form to go through two layers of validation before passing:
- Use the validation packages provided by TG (tw.forms and formencode)
- If the first layer of validation passes, try to run the authorize.net charge. If this returns a response code of 1 (approved) then all validation has passed. Otherwise, invalidate the form and flash the authorize.net error.
tw.forms and formencode are awesome packages, but at first glance there didn’t seem to be “one obvious way” to do things. I found the documentation and tutorials to be scant at best, and eventually went to the TurboGears mailing list for help. In spite of the fact that I’d probably give TurboGears a “C” at best for its documentation (not to mention the availability of “verbose” tutorials), the folks on the mailing list and IRC channel (when it’s actually active) seem to be quite helpful.
Eventually (and with additional help from Google’s source code search) I was able to hack together something that worked as planned, and was overjoyed to observe chained validators in action. Below is some example code provided for your hacking pleasure. To download the full example file, see the links at the bottom of the post. (continue reading…)
Version Control Systems: My opinion so far
by Seth on Jun.20, 2009, under F/OSS
There’s been a lot of noise in the development community over the last year or so about DVCS. Being highly opinionated myself, I can’t help but take a minute to share my own thoughts on the matter.
Let me start by first of all saying: Yes, it’s true. Distributed Version Control Systems really are everything that Centralized Version Control Systems (read: SVN/CVS) fall short on. However, having been a long-time Subversion user myself, as well as the fact that I hardly ever work on a team with more than a couple of other developers, it took a lot of noise to make me even care about the differences between DVCS and CVCS. So what is the difference you might ask? Almost everything; and that’s a good thing! (ok, that’s a slight exaggeration, but the benefits are so profound it almost feels that way)
Don’t worry, I’ll spare you the repetition of what has already been said elsewhere. My story is this: I spent about a month looking at the various DVCS’ and eventually narrowed it down to Git vs Mercurial (why anyone would use Bazaar over Mercurial is beyond me). Since I’m a Linux user, and since Github impressed me, I finally decided to go with Git on the next project that came my way. Boy oh boy do I wish I had run across this article beforehand… (continue reading…)