Ripping CodeIgniter a New One, Part 1

To be fair, CodeIgniter has its advantages. I don’t want to make it sound like you shouldn’t use it, because it is in my opinion that it sucks. I’m sure the company behind it thinks quite highly of it and I’m sure some of those reading this also believe it to be either great or acceptable with their project. Not to take away from the project and those using it, but it is just not the way I would have wrote the framework.

If you would like to know, how I would have built it, then take a look at the Yii Framework. Well, then again, there are disadvantages to using the Yii framework as well, but I’m not going to get in to those until I start using it. Furthermore, to maintain quality and for time constraints, it is probably better to use a framework, which flavor you choose and run with it. No framework is going to be perfect, unless you spend the time to build it specifically for your project and even then, the quality depends on your level of expertise.

  1. Short learning curve.

    The advantage of CodeIgniter is that it really does have a really short learning curve. Well, granted I did have an base to build upon, but it isn’t complicated as much as the Zend Framework is to get the code bootstrapped and up and running. The documentation is stronger than most and the structure is such, that once you get past the initial learning phase, you should be building a web application in short order.

    Doesn’t matter what framework you are using, having a short learning curve is almost a requirement. If you are spending more time learning how to use the framework than actually coding then there is something seriously wrong. I do like that it works like others where it can work off a set directory structure to quickly get the controllers and models built, then call the views. Works a bit like Cake in that way, but doesn’t restrict you completely to that set directory path, nor does it restrict you where the directory path is located.

  2. You can place the application files anywhere.

    Well, in this instance it does require a bootstrap file, but the bootstrap is far simpler than other frameworks or class libraries. I don’t like being bored with the small stuff and I don’t like being completely restricted on where I can put my files. CodeIgniter gives me enough freedom that I can forgive the other parts and well, it is probably faster when doesn’t have to configure every directory path and just “knows” where to look for the controllers and other files.

  3. Robust active record database SQL abstraction.

    I kind of scoffed at the idea, but it is really actually convenient. It is lighter than ADODB, but still has majority of the features. While it isn’t exactly how I would have developed it, it works and it works very well. Likewise, it does have neat methods that speed up development.

    For example, it will return an array of objects or arrays and while PDO does this faster, CodeIgniter does this with MySQLi and MySQL as well.

  4. Tutorials and documentation.

    I’m not entirely sure I should give it this one. It doesn’t have a lot of inline documentation or not enough for novices to pick up the parts that aren’t in the tutorials. If you can read code, then the CodeIgniter isn’t anything you should have difficulty with comprehension. Still, some tutorial documentation is far better than none and the inline documentation (that exists) is still better than none. I think it is all that can be asked of the developers to provide who are offering a framework free-of-charge and with a liberal license.

  5. Liberal license.

    It doesn’t matter, if you’re not distributing the project. For those who are and want to sell the product, then it will matter. The license is stated to be comparable to the BSD license. Whether that is the New BSD or old BSD is probably going to take a lawyer to parse the legalese. Basically, you can do whatever you want, as long as you don’t say you wrote the library or hold the developers of CodeIgniter liable for any damages using it might cause.

I suppose the advantages compared to others is debatable. There is really only a few advantages here that the others don’t offer. The first is going to be the deal breaker or starter for many project managers. It matters not, if the framework is written well, follows all of the best practices, and is fast, when it takes forever to get people trained and get started with the project. Well, the Yii Framework does have a PHP script that will build your application for you and also build the skeletons for the CRUD for the models. However, the Yii framework is a bit more involved than CodeIgniter.

I suppose in conclusion, it is not for me to decide how you choose your framework or if you even write your own. This is purely an academic exercise. Take it as you will.

Possibly Related Posts:


1 Comments.