I’ve been thinking about the pros and cons of using CI. So far, the pros are these:
- The MVC (class/function/id) approach. This makes up 95% of its benefits to me.
- The vast amount of libraries available like the unit testing class, calender class, form validation, etc. Thats the other 5%. (Although right now I use only the validation class and might use the calender class sometime).
Here are the cons:
- Integrating my own libraries, such as a user authentication library, XAJAX, and other things are a pain.
- Not having an idea of exactly what happens to the $_POST, $_SESSION, and $_COOKIE data before they get to my code. Right now I’m struggling with a bug in my login/logout system. For some reason, $_SESSION seems to be unset somewhere. I’m pretty sure that none of my code (only one controller right now) unsets it. But still if I try to do a print_r on $_SESSION in my view, it throws a notice saying $_SESSION isn’t found.
- The system used for displaying and nesting views is seriously complicated. I just don’t understand it. It seems to be nesting ob_start() calls all through the code and I don’t know how and where it ob_end_flush()es them. For my previous code base, I would only put an ob_start() in my common.php file (called at the beginning of each file) and an ob_end_flush() in my footer.php (called at the end) and everything would work fine.
- Calling a file which contains nothing but procedural functions is very hard. Right now, I put a hook to a function which manually includes my functions.php file.
- Each upgrade of CI seems to break my old code.
- Tracing bugs is very, very hard.
- A vast amount of useless processes like writing to logs, etc, which I rarely ever use.
- All in all, it boils down to one fact that I want to have complete control and know everything about what happens when someone visits a page in my project.
Based on all these things I’ve decided that after my next project (which I’m doing right now) I’ll say goodbye to CI and build a custom framework, which uses CI’s class/function/id and a folder for controller, views and models approach. Everything else is done my way. I have a deadline to meet with this project, but if it gets too hard to continue with CI’s buggy code I might just go ahead and build it right now.
