I’ve been getting excited about and have started talking about CodeIgniter 4 a lot more recently. Several people have asked “that isn’t dead yet”, “why”, or similar questions so I’m going to give a high level overview of the what and why of CodeIgniter 4.
I’ll be speaking just of my personal opinions and will do my best not to misrepresent my fellow CodeIgniter Council members who have by far done the majority of the hard work with the development of version 4.
Let’s start with some context around CodeIgniter
The general ethos around CodeIgniter, both as a community and as a framework, has always been to “get shit done”. People are drawn to CodeIgniter for a variety of reasons. IMHO the main draws are it’s relatively short learning curve, stable API, lack of opinion about how you code, and the way the community celebrates shipping over perfection.
This served the community well for good a while but over time the apprehension towards breaking backwards compatibility and general neglect by previous maintainers caused it’s community to slowly dissipate. It was hard to get excited about starting a project with CodeIgniter when it hadn’t been updated to support any of the enhancements to PHP from the past decade and didn’t even play well with others.
Around the same time as CodeIgniter was fizzling, Laravel came on the scene (I’m personally a big fan of Laravel by the way). A lot of the CodeIgniter community moved to Laravel 4 once it was released. It had a very simple architecture and followed a similar design philosophy to what we were used to.
This resulted in CodeIgniter stagnating as far as most people were concerned.
Where we are now
A couple years ago CodeIgniter was acquired by The British Columbia Institute of Technology (BCIT) and fully open sourced. This gave the community the opportunity to take control of the development of the framework and started pushing it forward.
With a community driven team in place, version 3 was soon finished and released. Version 3 was an incremental release so development was quickly mapped out for a truly new version of CodeIgniter. This version would have the latest PHP features but still allow you to develop a simple app end to end. Version 4 was born.
Development on version 4 has been slow but very well considered. Release of a public stable version is getting increasingly close, likely to be later this year or early next year (not official).
Now to the real point of this post and what you’re probably here for. Why.
In the current PHP ecosystem, where most frameworks resemble Java more than the PHP of a few years ago I think there’s a real niche in the market for a framework that is quick, simple, and easy to use but still gives you all the power of newer PHP features.
Laravel has moved to version 5, which leaves simple MVC behind for powerful, and complicated, command bus style architecture.
Symfony has continued to evolve and become a bastion of modern PHP and everything that entails. Both good and bad.
Kohana is dead. Yii, all but dead. Etc.
On the plus side. Micro-frameworks have become a ton more popular, Slim and Silex are great tools that I absolutely love. I use Slim almost every day.
The problem with micro-frameworks is that they force you to practically design your own framework from smaller pieces. This can be great for an experienced developer or team. This is absolutely horrible for a new developer or trying to onboard new developers to a large project or simply for getting a project off the ground. I can’t tell you how many times I’ve had an idea for a new app but by the time I picked out all the tools to use and setup the project architecture I was tired of the project and abandoned it.
That’s why I’m really excited about this next version of CodeIgniter. It gives you the simple MVC architecture you’re used to. Basic routing. Real classes without the wild loading things old CI used to do. PSR-4 autoloading. Tests. A full stack, end to end framework, that you can download and immediately see work in your browser. You can edit two files to serve up a static site. Three files to add a new model/view/controller that serve an app.
I have nothing against the other frameworks mentioned. I’m a big fan of them for the right projects and will continue using them. I’m also really excited for CodeIgniter 4. It gives a new developer a great place to start. It gives me a way to get a new app shipped without worrying about what the newest routing library is or how I would architecture at the scale of Facebook. It gives an experienced team an amazing starting place to create an app that’ll be used by tons of users and that they’ll enjoy working with. It’ll get out of your way and let you code.
You can check out the current process on Github at https://github.com/bcit-ci/CodeIgniter4. It’d be awesome if you could contribute.
Hit me up on Twitter, I’d love to hear your thoughts.