[Opinion] Why PHP Developers Choose CodeIgniter

March 28th, 2011 by aditia rahman / 11 Comments  


Codeigniter is one of the most popular php framework out there, that have been used by many php developers around the world. This post is just my own opinion from my technical experience while using codeigniter. This graphic below is taken from google trends to compare codeigniter search popularity, than any other popular php framework.

codeigniter, cakephp, zend framework, symfony google trend

The first php framework I use is cakephp, it has a lot more features than codeigniter, very detail documentation too, for the first time it will take some time to understanding, exploring the features and find some other reference online.

Below I mention some my opinion why people choose codeigniter, some may show it lack of features, but behind the lack of features, codeigniter can be use to get an easy understanding of php framework, and the most important thing is to get the job done as soon as possible. please note that this reason maybe for a who are new with php framework

1) Do Not Have Command Line

Most of php framework come a command line feature, I haven’t fell the benefit command line in the real project, but this article will help you to get an idea why command line is useful, my point is not much web application need to have command line.

2) Do Not Have ORM

ORM is very useful when dealing so many database tables, but in simple web application this feature do not need to use, when I first learn php framework, I don’t really know about ORM, and when I read the ORM section I feel like that it need to be in every web application. The good thing I learn about what ORM is, the bad thing is if we are in hurry, it will cost more time.

3) Great Documentation

Codeigniter documentation sure really written well, even for developer who are not familiar to MVC pattern codeigniter documentation is one of good place to start, it is not really perfect but you can get the most out of the features here.

4) No Plugin

Since version 2 codeigniter remove plugins, from it feature, because he ambiguous with “Library” and “Helper”. It good to not to make a term confusion.

5) Performance

Codeigniter not really the fastest but one of the fastest, also I never test it by myself, cause I think it doesn’t really necessary, this two benchmark maybe can be as your benchmark reference (benchmark 1, benchmark 2), but don’t rely on these to much cause “Hello World” application benchmark cannot measure overall performance when the web goes live.

codeigniter logoThe conclusion is I’m not saying codeigniter is the best php framework, but it really good for everyone to getting started with php framework. One point, It will save more time when learning all the framework scope, but if you are a experience php developer and have more time to learn why not trying some more advanced framework like Symfony or Zend Framework.

        submit to reddit Delicious

11 Comments Leave a Comment Subscribe RSS

  • Splover says:

    Also there are awesome ORM for CodeIgniter you could simpàly add.

  • ThallisPHP says:

    In CodeIgniter I can develop from scratch, the first step is very fast

  • dr.emi says:

    I’m web developer that really love Codeigniter.

    Before I learn codeigniter, I have used CakePHP. And the result is, learn for codeigniter is faster than CakePHP. It’s caused maybe, CakePHP have too lot of “sign language, secret code”. It’s make my work slow down when using CakePHP, I’m not free!!

    About Console: Idon’t need console or migration at all, because we have phpmyadmin as user friendly manager. That’s it!

    Codeigniter is the best for me!

  • Thiago A. says:

    CodeIgniter is good for newcomers, but it sucks at its core. At first it looks like a clean and polished framework, until your needs grow and you spend more time with it than you should, trying to fix its defects. Just a few reasons on why I think it sucks:

    1) Because it is controller-centric, it promotes bad code reuse… what if you want to reuse a validation? you have to rely on a horrible config file (containing all your app’s validations), when all validations should be inside the models. Even if you use a config file to reuse a validation, you have to rewrite all the callbacks in your controller… believe me, I tried other ways. Maybe extending the form validation stuff, but it still gets messy. It gives you no option of placing callbacks anywhere else. That is a signal of bad design. Just about every controller you code is big, and you very likely to repeat code everywhere in your controllers. It’s hard to fix “defective by design” code, so you’d better go off with something else.

    2) The loader stuff only loads singletons. It’s not a true object oriented model. There are many times I need to write a class which I can instantiate as many times as I like… if the user wants to get rid of the loader stuff, he has to require all files manually using APPPATH.’library/…’ and such. You can use the loader too, but you have to load the object inside the controller first, and then use the “new” operator to instantiate objects. That is very messy. Library constructors only accept an array argument… that is alright for simple applications, or for people who don’t care. But as you grow as a developer, you feel the need for more flexibility.

    3) Just about everything you want to do in CodeIgniter when building a real application needs tweaking here and there and extending here and there on core librarys. It just feels wrong, you end up writing tons of code, when a framework should help you instead of working against you.

    4) The $CI superglobal is absurd… there are many better ways of writing the core of a framework, instead of relying on a global variable for everything. When you write what they call a “library”, you usually have to do the ugly line “$CI =& get_instance()”. CodeIgniter uses some of the worse practices in development… you can’t use CodeIgniter stuff in any other framework or codebase.

    5) Pagination sucks… why do they accept the offset instead of the page number as a parameter on the URI? There is no accessibility in there.

    6) No $_GET variable… that was a stupid decision that doesn’t help at all. Try to code a search form in CodeIgniter… you have to do it using POST, which isn’t recommended for the job for the way it works on web browsers. Besides, it’s messy to get search parameters randomly at the URI. An option is to write some tricky code and rely on the database, inserting the queries and using a query ID. But that is too much work for something that should be simple, too tricky.

    7) It is like windows… version 2 is around, but a lot of these faults still persist, because of backward compatibility. I don’t see a chance of it getting any better, unless it gets radically rewritten. It still has a lot of things in the PHP 4 way, or worse than the PHP 4 way.

    There are many more reasons why I don’t touch it anymore… and some good things and features as well.

    • Thiago I agree with you in some point, pagination need to be fixed, it should make the page number as a parameter
      I never like the validation if we not creating our own library we have to write the same code in many controller ,
      and yes if we enable query string to get the $_GET variable the url kind a messy,
      I don’t have any experience to the other point that you mention, thank you for sharing

  • Marcus Tucker says:

    Beware! The popularity of a search term in Google isn’t necessarily a reliable guide to its popularity / how good it is… in fact, I would expect it to tend towards indicating the opposite, as the more issues developers encounter with something, the more Googling they will do to try to find a solution…

  • Sumeet says:

    The reason i like CodeIgniter is the concept of “Do the way you understand the best” keeping yourself in a MVC environment. Zend is way too complicated.

  • gheumma says:

    good article, do you have any idea to be advance in css and jquery ?

    • well there are a lot examples in jquery like the jqapi documentation is one of good reference for it, same as css too, there are bunch of great reference and example, the fastest way maybe forcing it to do some project involving these two subject

  • Stunt says:

    I already work with CakePHP but Cake is good when you want play by your self and your time and do complex action to get simple result ! but why ?!
    I think they are geek but much than us ! there is too many unnecessary steps for start project with Cake ! but in CI everything is simple and framework is powerfull

    Codeigniter is very simple to work . Other frameworks make works harder and twisted , involved, complex , indirect just for doing simple actions that developers can do easy with Codeigniter !
    like CLI that you say. if project need CLI ! developer can add it to project ! but not for framework startup !

    Codeigniter have powerfull document. and tell you that you can start your work simple ! but if you want do it with other way there is tools like sparks and more ..
    but in Cake and others. they tell you there is too many ways to doing it complex but there is just one way to do it simple that not recommended and not documented.

Leave a Comment