Posts Tagged ‘web’

Pylons (ftw?)

Thursday, August 23rd, 2007

After doing a lot more research on frameworks, playing around with SQLAlchemy, etc., I have decided for now on Pylons.

Here’s why:

  • SQLAlchemy rocks.  Ran through the tutorial, looked through the docs.  It’s very well documented.   The tutorial was advanced and I like that.  It even went through complex joins and such.  You can make it work with a schema.  It’s more complex than ActiveRecord for doing simple things, but it’s easier to do the more complex things without writing your own SQL statements.  It’s also nice when you use it in interactive mode how it spits out the SQL it sends to the server.  Great for tweaking and debugging.  You can use your own naming conventions too (which can be bad and good).
  •  The debugger seems great.  I played around with it a little bit.  Basically, when you get an error, you can click on the page and execute any command wherever you want on the call stack.  It updates all ajaxy too.  Very cool.  Just make sure you don’t run it as root by accident :D
  • WSGI is seemingly pretty awesome.  Middleware looks like it has a lot of potential.  Seems like all the momentum is headed towards WSGI.
  • Isn’t all about the CRUD.  I’m kind of sick of those slight of hand demos with Rails and such where it shows you how to make a blog in 20 seconds using scaffolding.
  • It’s lightweight, moreso than TG.
  • The docs explain not just how to do things but why as well, so you actually learn the underlying concepts.
  • Seems like there’s a lot of new development, and I’m hoping that once I get going I’ll be able to contribute to the project as well.  Also, TG2 is going to be using pylons which means the number of people using it will grow significantly once TG2 is released.  This is good for everybody because the middleware created, bug fixes, new API features will benefit all.  It’s nice seeing open source projects converge rather than fork for once.

These are just things I see from playing around with it a bit.  I haven’t made anything real yet, but when I do, I’ll share my experiences, post some snippets, and maybe a tutorial or two.  I have a long way to go though.

Rails, Django, Pylons, CakePHP, TuboGears, etc. Choosing the Right Web Framework.

Friday, August 17th, 2007

I’m planning on doing a web application that will have to scale immensely. It will require support for complex SQL queries (or using stored procedures in PostgreSQL), and it will have to scale.

The first framework I looked at was using Rails, which is an obvious choice. I’ve done some basic apps in it in the past, and I am very familiar with the Ruby language itself. Ruby is slow. On some benchmarks I’ve seen it 3-5x slower than Python. Also, I don’t like how it’s a struggle to make complex queries that are efficient. If there’s an easy way, it’s not well documented. I’m a little beyond the “Here’s a movie that will show you how we made a blog in 10 minutes using scaffolding.” Gems is pretty nice too, but I think I will pass on rails this time.

I found CakePHP next, but I really would like to stay away from PHP. I’d write my own lightweight framework if I were to use PHP. I’ve also heard that people have had issues with it.

After that, one of my friends suggested Django. From what I can tell, it would be great for an intranet or something like that because it can have many portals and such. It looks like the templating system is pretty solid too from what I’ve read. It hasn’t sold me. I want to try something different from rails that isn’t a full stack.

Next, my friend recommended I try TurboGears. Sure, it flaunts it’s 20 minute wiki, like Rails flaunts writing a blog in 10 minutes or whatnot. I like how it just ties existing components together. This means in the future if I need to write my own custom templating engine, or model to suit a specific need, it won’t be a huge pain to integrate it with the rest of the site. I’m kind of sold for now, but I still need to set it up. I also REALLY like how TG2.0 is converging with Pylons to make it play with WSGI nicely

After looking at TG, I was obviously lead to Pylons after reading about TG2, because it’s a web framework as well, that acts like a glue with certain Python web technologies to make an MVC framework.

While looking for the perfect framework, I keep going around in circles. I obviously can’t write my app in each one and see which one is the best. None of them are really proven. I mean, I keep consider just using PHP and smarty for templating. I really want to stay away from PHP though. I’d like to learn something new.

Also, it seems like all the reviews/comparisons on frameworks I have found are dated at least a year and subjective. I understand it’s not really possible to have an objective comparison on frameworks. At least with languages you can have benchmarks, but with frameworks it’s not always CPU cycles that wins.

I also looked at Zope, but it’s not really practical for what I am trying to accomplish.

Right now I am going to attempt TurboGears (using SQLAlchemy and Genshi). SQLAlchemy looks tempting because I read that you have more control over your queries with the “Data Mapper” paradigm versus the “Active Record” one. Genshi seems sweet too, even the author of Kid (the current default templating engine for TG) endorses Genshi. It seems like there is a lot of momentum behind it.

I will share my experiences with TurboGears or whichever framework I end up going with. Stay tuned!

Also, please feel free to correct me if any of my assumptions are wrong.