After spending time with retro coded content management systems like Drupal, I started getting frustrated with developing. I started reading about web development frameworks on blogs like Sitepoint & Smashing Magazine.
Content Management Systems definitely have there place in the market to quickly build templated websites that you can hand over to clients but web frameworks are now my option is a project is more bespoke.
I tried a lot of different frameworks, although most were very briefly tested due to my impatience. The ones that really stood out for me were:
- Codeigniter – PHP
- Django – Python
- Ruby on Rails – Ruby
Each framework has its good points and its bad points.
Django has received great press over the past year with people raving that it is super fast, and quick to develop on with it’s built in admin scaffolding. I just didn’t get on Python, its indentation and need to now classes to import. I had a fiddle around but unfortunately don’t have enough knowledge to share with you.
Codeigniter – www.codeigniter.com
When I started trying out CodeIgniter, one of the big pulls for me was Ellis Labs, the framework creators. They were also (at the time) working on rewriting their popular and highly regarded content managment system Expression Engine on the Codeigniter framework. I saw a good mix. A CMS for quickly building templated websites and a framework for building bespoke projects. I checked for updates on the release of Expression Engine for over 8 months with promise of a beta soon. Sorry Ellis Lab, I just got board of waiting and went elsewhere.
That being said, CodeIgniter does rock.
Setup & Installation
The first PHP framework that caught my eye, Codeigniter was VERY easy to setup and get started. Simply download, drop in your desired folder and away you go. The documentation is also really helpful to get started and show the ropes. The community is very active with plenty of users in the forum and new blogs popping up with extensions.
Coding
Built using the MVC pattern, and with plenty of classes built in, it is easy to see results quickly. Every class in CodeIgniter extends from the “Super Object” so the code is consistent and clean when learning.
$this->load->view('myform');
Unlike frameworks such as Cakephp, CodeIgniter doesn’t have “automagic” that loads classes and requires you to be more verbose in the controller.
$this->load->library(‘form_validation’);
Frequent used classes can be loaded in the config but this can slow down your app if used too much.
Speed
In benchmark tests on various blogs such as Avnet Labs, CodeIgniter is the fastest of the PHP frameworks… by some way
Community & Documentation
Codeigniter’s User Guide is great. Hands down one of the best I have used. It is so easy to read and quick to go through that I got through it in an evening and was building apps straight away.
The community Wiki has a good selection of libraries for authentication and databases extensions.
Ruby on Rails – www.rubyonrails.org
A few years ago a friend of mine asked me for help with his web development disertation for university. He said “my lecturer has told to give Ruby On Rails ago. He said it is going to be the next big thing”. My response to him was “what the hell is Ruby On Rails? I’ve never heard of it, and it sounds a bit Tomy-like. I would stick with PHP if I were you mate”.
Needless to say, he took my advice because he wanted help with his project. Admitably, Rails was in it’s early days when I spat my advice out but I am eating my words now! I’m partly wondering if I really give the best advice?.
Setup & Installation
Getting my development environment setup was pretty straight forward on my Mac. Ruby is pre-installed with OS X so you just need a few extras to get started:
- Ruby Gems
- Rails
- A database
Alternatively, just download Aptana (Radrails) and get everything except the database. Aptana is a great IDE for Rails and includes a simple to use GUI for running servers, generators and rake tasks.
Coding
Having never used Ruby before, there was an extra learning curve to get started on rails. Ruby is a very simple language to learn and once I grasped the new idioms and syntax such as symbols and instance variables, I could confidently get around.
One of the things I really loved when I got started was the ease and ability to interact with the database through ActiveRecord. What used to take a few lines in PHP can be done in one line using Ruby On Rails. Being impatient, I like it when things can be done quickly.
Ruby on Rails advocates the use of RESTFUL Routing which is great when coding from a standard “Scaffold Generated” Controller. It has taken a few reads of the Rails guide to get an understanding of how non standard routing can be used in harmony.
Speed & Deployment
Rails can be deployed on a variety of servers that each have their own performance.
- Mongrel Cluster
- Passenger for Apache
Reading the same Avnet Labs as seen for Codeigniter, Ruby On Rails ranks up there with CodeIgniter if not slightly faster on average in other blogs tests.
Rails includes 3 environments, Development, Testing and Production. Each environment can be configured individually to suit the relevant setup required such as database or caching.
Deployment to the Production environment was pretty tricky the first few times due to required gems and knowing whether the Mongrel Cluster was active (which took a while to find out). I actually got really frustrated when I tried to move my first Rails app to its production environment and wished for Codeigniter’s simple ftp upload.
As with many things to do with Ruby On Rails, simplicity and automation are key to a happy life. I would strongly suggest checking out Capistrano that will automate all those tedious processes you need to go through when updating your app such as version control and restarting the application server.
Ruby on Rails hosting isn’t nearly as available as PHP and therefore don’t expect many budget hosts to provide it, at least not flexible enough to allow gem installations. Picking the right hosting can be quite costly when choosing a managed provider but if you don’t mind getting your hands dirty in a VPS, I would recommend having a look at providers such as SliceHost. Their setup and installation guides are great!
Community & Documentation
Although quite young, the Rails community has boomed over the past few years since I brushed it off. There are plenty of forums and blogs to extend the verbose documentation provided at http://guides.rubyonrails.org/.
With the exciting merge of Merb in Rails 3, I am sure the community will get even bigger with plenty more contributions provided through GitHub.






