“Why develop a web app with CodeIgniter in 2016?”
This question was proposed as a subject by one of this blog’s visitors. It is indeed a good question, especially considering that “CodeIgniter remained way behind other frameworks”.
So let’s think a bit about why would we use an “aged framework” when we have great frameworks like… and here the typical example is Laravel.
I did try Laravel, back when it was at version 4.x. I was amazed at what that great framework can do. It was unbelievable. But a few months after that it became clearer that I don’t want it to do do everything for me. Why would I install such a huge framework for simple web apps?
And, is Laravel really a framework? No. In my opinion, Laravel is actually a collection of (mainly) Symfony components. And as you keep using Laravel you will actually use a lot of components that, because of their capability of being incorporated into a lot of frameworks, become more and more complex. And in the end you find yourself not programming what you are required to program but gluing components into a monolith. Do you really need that?
Laravel is like Java. Before creating the app, you must spend a lot of time importing all sorts of components, making sure that that component from that other framework works well with Laravel’s components. And I guess that is the case for a lot of frameworks these days. In the rush to cover all possibilities, needs and frameworks, the components become more and more complex (did anyone say “bloatware”?). In the end you won’t have the time to look inside the code of the component, because you will be too busy implementing the component into your application. You will actually have to learn so many new “languages” that you will forget how to do all of it in PHP.
Let me ask you a simple question: Do you know how to interrogate the database in PHP? Your (and my) answer would be: “Well… it’s simple… You create the model and use the necessary methods”. Oh… like so… “And what does the model do?” would be the next question. To which you might answer: “…”. Nothing. Nothing because we use frameworks. Maybe the CodeIgniter is not the answer, but at least this framework “allows” you to look inside the framework’s code and find for yourself how everything is done.
You may say that every single component written in PHP allows you to look at the code. But I will contradict you. What I learned from… learning PHP… is that there are a lot of methods to hide code. You don’t need to encode or encrypt your code in order to hide it from other programmers. All you need to do is make it complex enough for people to just ignore the component’s code alone.
Take my MY_Model for example. It all started as a question: How can I make a MY_Model that will help me speed things up when working with database? At the beginning it was simple… put that method, change that method a bit. But now, when someone raises an issue on MY_Model’s repository, I want to throw up. That is because the code has become so complex that it scares me to look at it.
And now, a year after its creation started, I can’t imagine working with anything else. But then I find myself forgetting the basic Query builder’s methods. Fortunately, the methods are so simple to understand that I wouldn’t give CodeIgniter for anything else.
And now CodeIgniter’s developers find themselves in the position to create a new CI. I sure hope they will maintain the same philosophy of a bare-bone framework that is fast and has everything we need without the need for us to import that and that component from that and that framework using composer and psr-0…psr-8, interfaces, middleware, etc. etc…
With CodeIgniter you simply download, configure and use.