New web development frameworks are sprouting out at a more rapid pace than anyone could keep up with. In this article, we are going to determine how to decide on a framework for creating your next, hot web application.
In this current day and age, pushing out a finished, polished application well before your competitor is key. Coding everything from scratch, excluding even the mundane things, can be extremely time consuming and makes the developer spend time reinventing the wheel, time which would rather be spent implementing new features or tightening up the code base. This is where web development frameworks come in. They often cover all the usual aspects of an application including database access, authentication, session management and much more.
Today, we are going to take a look at the various aspects you should be concerned about before choosing a framework. Interested? Let’s get started right away!
1. Usage Context

Before you even start looking at a frameworks, you’ll need to make a list of your requirements and whether a framework is suitable for that purpose.
You are in need of a framework if:
- your application is primarily based on CRUD operations
- you need proper separation of the UI and underlying logic but don’t have the time to implement a proper system
- you find yourself having a self made library you use in each of your applications covering user authentication, sessions and other usual operations associated with creating a web application
- you have a boss who wants you to create a CMS for them in 2 days and you already know the framework
You DON’T need a framework if:
- you want a pretty URL system alone
- you want only a specific part of the framework like its ORM
- you are on a tight timeline and you need to learn the framework from scratch
- you were told frameworks cure cancer
2. License

Before you start developing with a framework, see what kind of license the framework is distributed under. While most licenses are pretty liberal to work with and lets you create commercial applications, some of them are not so generous. The last thing you’d want is to create an entire application only to find out that the license doesn’t allow you to distribute it commercially. Better do your research before than suffering after.
Do note that this isn’t limited to the framework alone. The plugin or extension you made use of for the extra functionality may have a hidden clause. Check it’s license too!
3. Software Pattern

From the Symfony project
Almost every framework out there exclusively uses the MVC pattern. MVC, which stands for Model-View-Controller, helps you keep your data: the model, the logic: the controller and the user interface: the view, separate from each other. This in turn lets you write better, tighter code which ultimately results in better applications.
Just because almost everyone uses MVC doesn’t mean that is everything you need to know though. There are a couple of variants including MVP: Model-View-Presenter, MVA: Model-View-Adapter and AVC: Application-View-Controller.
4. Hosting Requirements

As web developers, we may be inclined to building applications on cutting edge platforms but often the need and budget of the client comes first. Often it may be out of the budget to get a dedicated host to place our applications on and we’ll have to settle with shared hosting with normal modules and settings.
Frameworks which play nice with shared hosting include:
- CodeIgniter
- CakePHP
- Kohana
- Zend Framework
- Most other PHP frameworks
Frameworks which require relatively non-traditional setups:
- Ruby on Rails
- Django
- Pylons
- Most non-PHP frameworks
In all honesty though, you can still run frameworks like Django off an off the shelf shared host. It’ll just require that the server has the necessary module installed. You may be able to run it off CGI but it’ll be a lot slower than running it natively.
5. Ease of Installation

Ease of installation plays a very important role whilst choosing a framework. A framework, however feature laden or quick it may be, can pose quite a problem if one has to run through a number of steps just to get it installed and working.
This will also pose a big problem once the application is ready, tested and needs to be deployed to the production server. A framework with ease of installation and just as easy deployment gets brownie points here.
For a lot of the frameworks, set up is as simple as setting the right values in the configuration file whilst for others it may be a very time consuming, elaborate affair. Choose a framework which lets you get up and running as rapidly as possible.
6. Learning Curve

Every framework has its own tiny universe: naming conventions, directory structure and what nots. Some frameworks are rather flexible when it comes to these while others are very, very strict throwing up errors at the tiniest of mistakes. Some frameworks follow general conventions while implementing a feature while others may strike out and do its own thing. While choosing a framework, remember to choose one that has the smallest possible learning curve.
If you don’t know the language the framework is written in, make a note of including the language itself to the learning curve. I’ve seen a number of developers jumping to Django from CakePHP and struggling since they need to learn both Python and Django at the same time. If you need to learn both the framework and the language it was written in, pace yourself!
7. Core Library

Let’s face it; it is for the core library that most people adopt a framework. The library must be in such as that it frees you from writing repetitive code but still provides a way for you to tinker with it if you need more control or features.
Most frameworks offer libraries which cover almost all of the following list:
- AJAX
- Authentication
- Authorization
- Caching
- Data Sanitization
- Data Validation
- Templating
- URL mapping or rewriting
Of course, not every one needs a framework brimming with features. A lot of people prefer frameworks to handle the bare minimum whilst letting the developer handle the rest. In these cases, you’ll need to make sure the framework in question has only the features you need.
A current trend among frameworks is that they are created as a library of libraries. In other words, it lets you swap out parts of the library with another part of your choice. An excellent example of this would be Pylons. It lets you switch out almost all of its parts starting from the ORM right down to its templating language. People like these loosely coupled frameworks just as much as the frameworks which are tightly couple with respect to its core components.
8. DB Abstraction and ORM

Almost every application has to access a database to either read data off or edit its contents. Either way, you’ll be doing this along the length of the application and with this in mind, most frameworks lets you use an database access class you can make a use of. So while choosing an application, choose one which lets your application become database agnostic. You’ll never have to care about the database part incase you need to switch out databases if your framework takes care of that.
The second part you’ll need to think about is the framework’s ORM capabilities. Without getting technical, ORM or Object Relational Mapping lets you express data as an object and see how it relates to other objects. Imagine an object database you can pull information from, if you will.
Frameworks which have ORM capabilities include CakePHP, Django and Ruby. With frameworks like Pylons, you can use your ORM of choice.
9. Included JS Library

Another point of contention is the bundled JavaScript library. While most libraries let you swap out the library with ease, the AJAX methods inside the framework are mostly still aimed towards a specific JS library. This implicitly means that you’ll have to manually write the functionality yourself. On the other hand are frameworks with library agnostic methods which let you swap out the JavaScript library with little to no hassle.
Just as a reference, both CakePHP and Ruby on Rails ship with Prototype and Scriptaculous as standard.
10. Unit Testing

I am one of those developers who swear by unit testing. Wikipedia defines unit testing as:
Unit testing is a software verification and validation method in which a programmer tests if individual units of source code are fit for use. A unit is the smallest testable part of an application.
Frameworks which lets me write unit tests are a definite plus in this case. A lot of frameworks including Code Igniter, CakePHP and Zend lets you create custom tests in addition to the core tests to check the critical parts of your application.
11. Scaling

The average web developer doesn’t have to worry about the scalability of a framework. As often is the case, I/O and network latency are often the issue rather than a framework’s scalability. Even Twitter’s mythical scalability problem wasn’t the fault of the framework in question.
If someone asks you to layoff a framework pointing out scaling problems, disregard them. The framework is rarely the reason of the scaling issue. Sure, you could optimize the code a little bit but often the brunt of the scaling issue lies elsewhere.
12. Documentation

A framework’s documentation is often key to its success. Well explained, detailed documentation draws in the power users and evangelists who then bring in more people. With shoddy, confusing documentation people are going to just walk off confused and annoyed.
Look for a framework which has thorough documentation with plenty of examples, snippets, sample code, articles and tutorials. Screencasts like Jeffrey’s are a special plus since it’ll let you zip right along.
13. The Community

Inevitably, even with proper documentation, you are going to run into errors to rectify which, you are going to have to ask the community behind the framework for help. I’ve personally interacted with communities which vitriolically attacked programmers new to the framework and sneered at them while on the other extreme I’ve seen communities cheerfully welcomes newbies and teach them the tricks of the trade. I think there is no need to say which framework I ended up choosing and started working permanently on.
As often is the case, the communities behind a framework make or break the framework. Too snobby and you’ll resent the framework instead of the people. Well mannered and you’ll gravitate towards the framework. Choose a framework which has a friendly community which helps developers new to the platform.
14. Bug Fixes/ Updates

One of the reasons web developers shy away from just creating their own frameworks is the fact that they alone are in charge of fixing the bugs and updates. With a big framework, you literally have thousands of programmers sifting through the code and putting it through its paces on a daily basis. Bugs, if and when they are found, are squashed as soon as possible after they are found.
Choose a framework which isn’t stagnant. You don’t want a hacker to tell you that a security vulnerability exists in the framework through a page he hacked on your site. You’d rather hear that from the framework developers, hopefully with a link to a patch to the issue. Choose a framework which is updated often, is open about the bugs it finds and more importantly fixes the bugs people come across as soon as possible.
15. Ease of Creating an Extension and Availability

While a framework covers all of the important bases of an application, chances are, you’ll still have to write a bunch of code. Make it generic enough and you can re-purpose it into a component suitable for reuse in your other applications or even better release it to the general public so they make use of it in their applications..
Choose a framework which lets you extend the framework easily and with minimal fuss. With CakePHP for example, extending a controller is taken care of by components and views by helpers. In either case, creating an extension is as simple as defining a new class which inherits from a parent base class.
While choosing a framework, also keep in mind the availability of plugins. Often you won’t have the time to create a custom extension from scratch. Having a huge pool of extensions to choose from greatly alleviates this issue. Choose not by the number of extensions but by the quality of the extensions.
Conclusion
And we are done! We looked at all the aspects you should consider before choosing a web development framework. We looked at everything from mapping out whether it’d suit our purposes to bug fixes and updates. Hopefully, this has been useful to you and you found it interesting.
Questions? Nice things to say? Criticisms? Hit the comments section and leave me a comment. Happy coding!
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for the best web development tutorials on the web.






Cool Intresting
Hmm i’ve been trying to learn that MVC ***** but i don’t get it. I tried with CodeIgniter..first of all the framework is big :O (few MBs) then it’s that thing that every file is on different place i had hard time finding my files and eventually i gave up working with MVC. I basically have few wrapper classes that i use in every of my projects.
The article is good i almost wanted to give CodeIgniter a shot again
and i might do it..when i get some more free time >.<
You don’t need a framework for MVC
Models are data sources .. mostly DB related but can manage other sources like Permission sets etc..
Views are the output. the Layout. having separate views allows for distinction between manipulation of the data and the manipulation of display.. Good template/view class for php5 = Savant3
Controllers are just uniformed way to control what gets done for a particular scenario.
So all in all, you don’t need a framework for MVC but having a framework that doesn’t do MVC would probably be a bad thing
… and you really should do so! Starting with MVC really IS hard, but once you got it and have worked a couple of times with it, you’ll love it. No need to say that CodeIgniter gives you so much more. Apart from certain frameworks, the MVC pattern is often needed for developing application extension, e.g. Joomla! components (although their pattern / structure is slightly different).
You should watch through nettuts tutorial series for CodeIgniter! That really helped me out understanding the way CodeIgniter (and MVC) works. Understanding MVC theoretically and practically is really two different things!
Cool
And for projects that don’t need a framework, i often consider using Flourish. Available at http://flourishlib.com/
A PHP Library with all classes that can be necessary, and even more
“Frameworks which have ORM capabilities include CakePHP, Django and Ruby.”
Ruby is not a framework – Ruby on Rails is.
My bad. I typed Ruby while meaning to type RoR.
how about Day 7 in the serie CodeIgniter From Scratch?
I think the backing of the framework is somewhat important. When I jumped onto the Zend Framework bandwagon a couple of years ago, the participation of IBM made me feel safe with the future of the Framework.
Ah yes, Notepad++ = the shit
I used to say the same thing, that is untill i discovered netbeans! pure bliss
I still use Notepad++ for single files =)
I rather don’t feel anything bad about Notepad++ at all. I adore it, but that could also be because I love everything opensource
Nevertheless, it’s a perfect solution for people like me!
i’ve always hated IDE’s specially the ones written in Java, i feel like its just heavy even if it performs fast.
Siddharth,
Super article, you covered a lot of things I wouldn’t have thought of!
Namaste, Dave
Thanks for reading.
I have always wanted to choose a framework and force myself to understand it and become proficient in using it, but the learning curve is STEEP and I just don’t have enough time or large enough projects…
QUESTION: As far as project size and types, what are frameworks best used for?
All depends. There are a lot of large sites built using frameworks like RoR/Django, but the really big, high traffic sites are usually swapping out portions of the framework for custom stuff.
Frameworks are meant to solve the frequently occurring problems in web dev. But most large sites are going to run into the infrequent scenarios that frameworks are not designed to cope with. So you re-write that part.
And I wouldn’t agree with ease of install being a limiting factor for picking a framework. That’s like saying you wouldn’t buy a Ferrari because its going to take 2 months to custom build, so instead you go buy the Ford Focus off the lot in the same night. Often (not saying always), the payouts on time invested to set up the framework are well worth it. And it’s usually just part of the learning curve.
I started with CodeIgnitor, then made the switch to Django. CI took an hour or so to figure out and get up and running, but it took way longer to get anything useful done with the framework. Django took me a day or so to get it running (on Windows…much easier on a unix system) but I can spit out projects in a fraction of the time it takes to do so with CI. Now that I know how to set Django/Python up, I can do it in a few minutes by hand…or in a matter of seconds using PIP.
I would like to recommend Site5 to those who would like to run Ruby on Rails app on a shared host.
The right thing at the right time, specially for me and my colleagues.
My Problem is, that there are many great frameworks out there. Some time ago I had to made a decision between CodeIgniter, CakePHP, Symfony and Zend. There are to many Pros and Cons. My choice was CakePHP. I think the more important thing is to be great in using the framework of your choice and not to know the basics of every framework.
You’ve pretty much nailed the problem Tino, and the solution. I decided to go with CodeIgniter because I got the impression that it’s the easiest to learn and it’s well-documented. But I could have just as easily gone with Cake or Symfony.
The key, like you said, is to be great at the framework you decide to use.
Its ok.. But you need to add some more idea’s
Hello and thank you for this useful article!
I’ve been fooling around with php for few years now, and I feel that the moment when I need to step in to the MVC and framework field is coming closer, just waiting for the appropriate project to come around.
Cheers,
Martin
I’m a happy cakephp user, although I have been tempted by Django. My opinion on frameworks is that they’re great for helping non-genius programmers to write pretty good, maintainable code quickly. If I was a genius coder, I probably wouldn’t bother with them, or would roll my own, but seeing as I’m not – I find frameworks a lifesaver! It’s not just a lazy solution though, I’ve learnt tons, and become a much better programmer through using CakePHP.
Yeah, CakePHP is the best for data heavy apps in my experience. I havent used ZEND cause their is just way to much in it and I can use any of the components in it with CakePHP if I really need them.
CakePHP has made me a better programmer as well.
What are your thoughts on Drupal?
I’m going to start making a website in the Christmas break for my soccer team and I was suggested to use Drupal because I want forums, and easy setup.
Drupal vs. Django, what would pick?
If you see that all you need is available as Drupal modules, then you should choose Drupal.
If you knew Python, MVC and some Agile Development methodology and you want to build the website from (not so) scratch to fit needs, then you should choose Django.
About #8:
You can also add an ORM to a framework yourself.
Adding Doctrine to CodeIgniter: http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup
Awesome Tut Siddharth, after following Jeffrey Way’s CodeIgniter series it changed my life it saves a lot of time and makes development easy.
Happy Holidays
I like CodeIgniter and love to see more in CodeIgniter series.
Natrium also commented for
– Day 7 in the series CodeIgniter From Scratch
I couldn’t agree more, I must have changed my framework at least a dozen times on my current social networking site it’s such a pain. Starting off right from the start saves a lotta headaches down the line
This is very nice tutorial. Thanks
will read it later, but this is what I needed… Because my head will explode if I will use it to choose the framework few days longer
Thanks!
I wish this article had been written a month ago, as I have just started building my own framework and some of these points are pure gold!
Glad I made the jump to do my own though, and especially agree with the learning curve graph
Haha. I’m glad you found it useful.
cool! nice tutorial.
Better to choose a framework which supports more than one JavaScript framework. As nice as jQuery is, whenever you would like to create a really good organized RichClient-Application, you will leave jQuery and use Dojo Toolkit instead.
Zend Framework offers both: it delivers Dojo Toolkit as standard but it also offers jQuery helpers. And the community behind Zend Framework is big and really great. Therefore I prefer Zend Framework.
Any reason why my comment is still awaiting moderation?
lol @ “frameworks cure cancer”. That’s just silly. Everyone knows frameworks cure world hunger.
or perhaps Global Warming!
Haha. Some people choose frameworks for all the wrong reasons. I’ve had a friend who chose RoR over Django because Django sounded funny.
Hopefully a simple question here:
I began developing sites back in the cold fusion vs. asp days. php was still young.
I made the move to java development from there and have stayed since.
I do though keep an eye on the web dev community and often have opportunities to build small business sites for friends and acquaintances…
What framework / toolset do folks typically use for a standard small business with simple dynamic requirements like contact forms, maybe a press/events listing page… you get the picture.
Do you use a framework, simply roll your own with php, or?
Depending on how much they pay is how I develop
If its a simple web flyer type page I’ll just static code it up in Dreamweaver.
If they need a few controls (contact forms, press page) I’ll throw in some minor php or jquery to make it happen.
If they are paying top dollar and the site needs it they get MVC with a php backend, jquery interface to ajax items, mySQL database, XML…yada yada yada.
So basically, sites for a friend or acquiantance I don’t use a framework. Give em something static with dynamic snippets, just make sure they don’t change it much. Saves time and they have no idea how its being done.
nice! I like this articles. gave me more info!
Using a framework has improved my code. Spaghetti code is a thing of the past, because the framework has helped me stay organized. I chose CodeIgniter after some experience with Kohana. Whatever you use, I’m just a big fan of frameworks. Yay frameworks!
I custom code all my stuff. It blows away frameworks in terms of speed and memory consumption. Clients are happy with NOT having to have HUGE servers to power slow OOP Framworks. Their pages load blazing fast, and customizing the code is a snap for any SOLID PHP programmer who knows what they are doing. There is a community to my code, its called the PHP community.
Bottom Line
– Learn Good Coding Practices
– Master Good Coding Patterns
– Create Re-usable code
– Make you number one goal be decreasing the time it takes for a Request to come in and Output to Browser.
Peace and happy coding
Agree
I used ot use cakePhp..
I find it to bloated and too slow
Then i just code all my stuff..
If you are going to follow the CodeIgniter from Scratch Series, consider that: CodeIgniter from Scratch day 7 and CodeIgniter from Scratch day 6 screencasts are dead…
MVC pattern -> TYPO3 4.3 (ext_base) -> great!
Does anyone know any good resource about learning Python? I guess it is much better to learn the language itself before jumping into a framework. I am happy CI user, but i picked it up after some time working with PHP.
There’s hardly any mention of security in these considerations. I think that should be extremely important!
great tutorial!
recess-framework anyone?
light weigth and awesome!
me likes Zend FW too
Which framework is best ?
nice help thanks …..i got why use framewrks….