Snippets
Blogging live from PyCon. One thing that I found really interesting during the tutorial sessions was to see what kind of development environment other Python hackers were using. At first, I found it quite unusual to see Joe Gregorio using gedit, an editor that I found very limited compared to the very rich traditional Unix editors like Emacs and Vim. Then Joe started giving us and overview of what appengine can do and I was blown away.
I mean, I was blown away by appengine but I was also really impressed by how efficient Joe was with his editor. One feature that was pushing him quickly from one from-scratch example to the next was the snippets plug-in for gedit.
Snippets are templates for typical programming constructs. There are things that we code over and over, boiler plate, repetitive code, almost always the same but not quite. You know what I mean, classes, for-loops, method definitions, test-cases. Python do well without most of the boiler plate code that is mandatory in other languages but you still have some of it and when you code all day long, it adds up to a lot of boiler plate at the end of the week.
I'm not ready yet to move to gedit so I looked for the snippet modes available for emacs; there's a lot of them. I know ELisp but as some people commented on the emacs wiki, a template language that is Lisp based tends to become too syntax heavy and hard to read for the kind of small pieces of code that you use snippets for. After looking at the non-sexp options, I decided to go with YASnippet. It has a very engaging demo screencast and unlike most of the contenders it's both actively maintained and easy to setup. I haven't used it much yet but I really like it so far.
update: the former link to the screen cast was obviously wrong. Sorry about that.
