With the emergence of web frameworks such as Django and Rails, there has been a big push within the web development community to build sites in a different way. Here are a few things that these frameworks provide:

  1. They encourage good coding practices like unit testing and separation of presentation logic from business logic.
  2. They come with functionality such as caching, object-relational mapping (ORM), and AJAX libraries.
  3. They eliminate a lot of repetitive coding like SQL queries and form validation.
  4. They promote code re-usability and readability, making your site easier to maintain and more adaptable to change.

So, I installed Rails on my server and gave it a shot. I was surprised how quickly I was able to get a basic site with simple functionality despite having no experience with Ruby. I adjusted to the MVC way of doing things and was off and running.

However, my limitations as a newbie Ruby developer began to get in the way as my project grew in complexity, and I came to a crossroads-- I needed to either take the time to learn Ruby, or retreat to more familiar territory. I chose the latter. Being a longtime PHP and Perl developer, I started to look for other options, and I came across Symfony.

Symfony is a relatively new but surprisingly mature framework that met my needs in terms of functionality and also allowed me to leverage my knowledge of PHP. It had all of the features I was looking for, like ORM, MVC, caching, session handling, AJAX, deployment, and support for unit testing. And, because of my PHP experience, I was able to get rolling in a matter of hours.

Symfony is not a Rails clone like some of the other PHP frameworks out there. The developers have quite a few very fundamental differences in approach from the Rails way of doing things, for better and for worse. Each has its efficiencies and deficiencies.

I'm not done with Rails by any stretch of the imagination. Ruby is actually quite fun to program in. Its code feels cleaner and more readable than PHP. Also, Rails has the rabid community behind it that a young framework like Symfony can only dream of. But for this project, I just wasn't ready to dive in head-first.

Anyway, this site was written in well under half the time that the previous site took, and is much more complex (with the addition of journal entries and music reviews). And best of all, the code is clean, maintainable, reusable, and scalable (ieeeee, the buzzwords!). If anyone is interested in hearing more about Symfony, I'll be glad to describe the transition process in greater detail in future posts.

comments