This weekend I have been having fun coding on my laptop a report tool in web.py and basic Web (database) application in Rails.
Current versions of web.py didn’t have sqlite, but I hacked in support quickly. This is so opposite to my fumbling experiences with Rails…
I have the PDF of Agile Webdev and reading the PDF (in that monster acroread) sucks. The API is good, but you have to be online, as I can’t find it on my (often offline) Debian system. So I prefer Aaron’s simple python style web.py docs. Online I love that Poignant guide to Ruby, though I still find python docs just easier.
One thing I quickly noticed is putting Rails vendor/ stuff in source control was a bad idea. I sorted things out eventually, though I am struggling to merge some conflicts in svk. Argh, pain.
The generators in Rails are great, but installing them is a bitch as I discovered on my system. I eventually installed login_generator and got something working pretty quickly. Then when I upped it back to dreamhost, it seem that DreamHost doesn’t have login generator installed either. Omg, how do I install it? So deploying and managing code in web.py is 100 times better. Even though it isn’t a Debian package. 
Debugging in web.py is easy. I still not sure about printing and showing up stuff the way I’d like too in Rails. That makes me really blind.
I find Rails scaffold generator, form helpers and the model construct to save a bunch of time. So with database applications with luser input, I think I will still employ Rails. For smaller (more cutting edge) projects I will definitely use web.py.
Rails is definitely a phenomenon. Their mailing list is incredibly busy.
Dreamhost are great and everything, but it can be quite difficult to make full use of one’s host.
For example. I have more diskspace, so I was thinking of hosting a copy of wikipedia and abusing my near unlimited bandwidth. Not so fast:
pico$ bunzip2 pages_articles.xml.bz2 Killed Connection to dabase.com closed by remote host. Connection to dabase.com closed.
Hmph. Next things I’ve been playing with is Ruby on Rails.
Though I read the Wiki page I am experiencing Application error (Rails) whilst using Fast CGI. It’s a bit odd and somethings work. I know without Fast CGI, development iterations are extremely slow. You’re basically going nowhere without something like Fast CGI.
Then I had a look at web.py. It seems to require mod_python and again DreamHost doesn’t seem to support this module. Oh crap.
Django seems to be able to utilise Fast CGI and I tried a very basic sanity test for Fast CGI via Python and that doesn’t work either.
So where are we? Back at square one. This blog about The sysadmin view on PHP is actually quite right. It is so easy to deploy a PHP application in comparison to Rails and Python.
I almost forgot I work with Java, tomcat, JBoss and other hopeless Enterprise technologies. They need the server to come down to deploy. That’s Web 0.0.
Update: Dreamhost support spotted an error in my database.yml. It’s working! WOOT!
Update: With the help of Aaron Swartz I managed to get a web.py “hello world” working with fastcgi on dreamhost.
Update: Django on DreamHost does work. I missed the part about fcgi.py. Oops.
I’ve been wanting to try Rails for ages and recently I obtained a copy of the Agile Web development book. The new-ish language Ruby didn’t put me off as I played with it ( Tom uses it so I thought I should try it ) and compared it with Python sometime back when I was first teaching myself Python.
I chose Python as the new 3rd generation (or 4th?) language back then, as I often like to write code without objects. I also didn’t like the end syntax of Ruby and I kind of initially thought the indentation stuff with Python was a good idea. I’ve since gone off Python and my thoughts on Python are detailed in this blog.
Back to the reasonable looking Web Frameworks today:
I tinkered with Rails (RoR) samples (including wow-wee AJAX) from the book and with code generation (urgh) I had quite a complete database driven Web application in next to no time. The directory layout and overall design is pretty clever. I wasn’t too impressed with Web brick as I wanted to work with Apache. But after seeing the nice development logs it produces and increasingly despising Apache configurations, I learnt to tolerate it. I have no idea how stable Rails all is but with Dreamhost support and 37signals it probably does quite alright.
Ok things I don’t like about Rails. Where is the i18n support? The docs are pretty ugly, but maybe I am too used to frame-free Python Docs. It has a bit of an initial overwhelming feel, esp. as I often write “simple” (ok, trivial) Web applications without a need for a database. I still don’t quite know about the dependencies or have a feel for the stability of them, so it puts me on the back foot.
Django implements the same stuff as Rails by the looks I things. That’s a good approach, though that means it doesn’t look like it is bringing anything new to the table and it’s going to fight for Rails mindshare. Good thing for me is that I know Python better than Ruby, but I don’t think I want to spend time on it for now.
A cursory glance at Catalyst makes me think it’s also implementing those MVC thingies that Rails leads. The amazing thing about Catalyst is CPAN. Though my friends use Perl like crazy, I don’t think I want to go back to Perl code for some reason. Though I’ll give it a whirl with my dusty Perl books some rainy day after Django.
Ok, I’ll end this boring review with my burning thoughts:
- The “project weight” difference with simple PHP applications and say MVC applications is quite large
- I wish “UNIX” played ball better with the Web. I guess I’ll have to accept they’re almost incompatible
- I’ve got to take some time out to implement something in Rails
