mengu on web programming.

How To Choose A Web Framework?

I have started my web development journey with PHP. After a long time I heard there is something called web framework and then I wanted to learn the best one for me. I have reviewed and learned many frameworks and because of the fact that I'm a grasping person, I have learnt more than just one. Is this a mistake? A part of me says yes and another part says it's not a mistake. Both have reasons. So in this post, I will try to write a simple and short guide for people who are desperately unstable on choosing a web framework. Why learning more than just one framework is a mistake? All across the human history there is only one thing that is most precious. Time. Once it flows, you can never get it back. Instead of trying to learn more framework which will take really long time of yours, you must spend your time on producing something real. While this will make you more experienced, you will be more confused. Am I regretting this? Once again yes and no. Yes because of the time I spent and no because I'm a greedy one. Unless you have time, just pick one and go with it. How should you choose the best framework for you? Let's start for that. Decide which language to use. ---------- You must first decided which language to use in order to choose a web framework. PHP, Python, Ruby and Java are some of the popular programming languages that are used for developing web applications. There are tons of comparisions of programming languages which make selecting the language a lot easier than selecting the framework. Decide what should the framework have for you. ---------- There are full stack frameworks like Django, Ruby on Rails, Grails, CakePHP, CodeIgniter, web2py, symfony and there are minimal frameworks like Werkzeug, Webpy and sinatra. There are frameworks which provide administration interface like Django, web2py and symphony and there are frameworks which doesn't provide administration interface. While full stack frameworks offer you many things like the built in ORM, template system, testing environments among other things, minimal web frameworks offer you a collection of utilities to develop a web application. What kind of application you are going to develop? Are you going to develop a big one or a simple one? That's one of the important questions you should ask yourself. Is it easy to learn and use? ---------- The framework should not be complicated. It should be easy to learn and it should be easy to use. It should be easy to edit the core when needed, it should be easy to contribute if you are willing to. And it should also be easy to customize. For example, if I need to make a comparison, I find Rails easier than Django and in my opinion Django is easier than web2py. Is it stable? ---------- I don't think anyone would want to use something unstable and buggy so you should be careful on this. Is it abandoned? No updates? ---------- I suggest staying away from the frameworks those are abandoned. Check the framework's trunk, check the last commit date. Another way to understand if a framework is abandoned is to check if the founder is still interested in it. For example from what I have seen webpy's author doesn't seem interested in the framework but there are many users of it and the community hasn't abandoned it so you must be careful when deciding if it's abandoned or not. The author may not be interested or may leave the team -if there's any- but the community can be carrying it. TurboGears is a good example too. It seems that the founder of the framework is not involved in the development and his last post on his blog about TurboGears posted at 28 October 2008 but TurboGears 2.1 beta was released on 25 January 2010. How is the framework's community? Is it active? Is it helpful? ---------- Community is what carries the framework and an active community is what carries the framework to the next level which is having more users. When learning the framework, you will have too much questions as a beginner. Where will you ask them or of whom you will ask your questions? Some of the frameworks have channels on different IRC networks and some of them don't. You can ask your questions on these rooms however there are also mailing lists of frameworks. You may not get an answer on IRC but you can get an answer on the mailing list so you may try both. Is it fast? ---------- One of the first questions that is asked in the framework communities is “is it scalable?”. I think this is something to worry later because it will take a long time to have big amount of users on the web site. The question here is “is it fast” enough to satisfy the users? For example, you can make benchmark tests and analyze the numbers. Ofcourse this is also about how you write the code and how you use the resources. For instance, you should optimize your back end codes, database queries, HTML, JavaScript and CSS. If you write bad code, don't expect the framework help you. Are you enjoying it? ---------- I think that a developer should enjoy the tool he or she is building the application with. So pick something you enjoy and don't hate when you are developing your application. This is all I can say to the indecisive web developers. Consider all of the above when choosing your web framework as all coming from an experience. Don't repeat the mistakes that others do. I hope this helps somebody. Let me know your comments on the post.
Did you enjoy this post? You should follow me on twitter here.

Comments

Tahir Akram said on 03/09/2010 08:45 AM
A very helpful article. I was looking that what things a web framework must have.

Mengu Kagan said on 03/09/2010 10:52 AM
Thanks Tahir! :)

Leave a Response

No HTML allowed. You can use markdown.
Name*:
E-Mail* (not published):
Web site:
Response: