Saturday, January 21, 2012

On Choosing a Web Application Framework

The Skyline MAD Team (Mobile Apps Development) has produced 3 working apps from scratch, using HTML5, CSS3, a little JavaScript and some PHP.  During the process, students noticed that we could re-use certain parts of our code between the apps.  Of course this meant that we did a LOT of copying and pasting of code from computer to computer--not the best development situation by any means.

We had looked briefly at a form-based web application framework that we experimented with.  To their credit, my students felt uncomfortable NOT being able to see all the parts of the framework.  We also had little knowledge about which database was being used, etc.

So it didn't take long for some of my Python hackers to write up a couple helper scripts that would lead the user through making HTML forms.  Python did all the work pasting the proper tags around the content.  The only problem was that we found ourselves having to tweak the HTML later on because we were using JQuery Touch or some other toolset.

We like PHP, but it is not our go-to language for scripting--that would be Python.  Although I'm not currently teaching a Python course at Skyline, Python is still the most popular language choice from my top programmers.  So, with 10 minutes to go before I had to leave for an eCSite meeting in Boulder, one of my students, tritan67, asked if we could update our server's Python installation to include something newer than the 2.4 that CentOS uses internally.  I started to say, "no, I gotta go, so maybe tomorrow...", but when it comes to Computer Science, I almost never take that approach.  So instead I said, "What the hell, let's do it!"  The next 10 minutes saw us googling stuff, downloading Python source code, and finally installing Python 2.6 alongside the 2.4 version on the server--compiling it from source.  After all the recent debugging frustrations with the MAD Team, it was like going home again when the Python installation "just worked."

I'm still a bit surprised how easy it was.  Not only did we get 2.6 installed from source, but tritan67 jumped onto a terminal, wrote up a and we confirmed that it was all working.

That was such a good feeling, that we started to immediately look for ways we could write our own framework using Python CGI scripts.  But--since there are more Python web frameworks than there are programmers--we figured we'd look into something like web2py or Django.

Haven't decided yet what we'll settle on, but it looks like either Django or the Google App Engine will be where we take this.  Of course I'd just prefer Django on our own server, but there's something to be said for the Google App Engine as a platform for teaching students how to make web apps.

Back to coding.  Python, we missed you a LOT.

No comments:

Post a Comment