web.py and the 2 minute wiki
A lot of people use my applications and then email me asking me which language and toolkits I used to build them. The language for both tasktoy and lazybase was Python, which is my favourite programming language. tasktoy was built using Zope and LazyBase using Turbogears.
Recently I built a new application, which I’ll be sharing with the world shortly (since I’m taking Spanish classes now, it’s a tool to assist with learning a foreign language — you can email me if you’re curious to hear more). Since I’m a big fan of reddit, I decided to try out web.py. I was amazed at the simplicity with which I could download and “install” the necessary pieces, and how quickly I could get a basic application up and running.
This got me thinking about all the tutorials for other frameworks, which show how to build a wiki in x minutes. The number typically doesn’t include time to install and configure the framework. So, as a simple test, I decided to see how fast I could, from a fresh python install, download and install the necessary components and build a wiki. My only requirement was that it support multiple pages, basic formatting, and internal and external links.
First, a few disclaimers:
- This is an uncontrolled experiment, not intended to prove anything, simply to satisfy my own curiosity. I make no claims about the superiority of any language or framework.
- This code was written very quickly. It is intended to work, not to be pretty, extensible, maintainable, or use design patterns.
- I had already used web.py for another project, so there was no learning curve. I did not consult any documentation while writing the code.
- This certainly does not represent the best way to use web.py. I put HTML in the code instead of using templates and I used an embedded database.
My results were:
Download and install markdown.py: ~1m (mostly clicking through sourceforge)
Write the wiki code: 2m21s (the only part that I timed with a stopwatch)
I wanted to post the code, but Wordpress doesn’t seem to render it properly. You can look at it here.
Finally, a screenshot of the program in action: