Welcome Guest, Not a member yet? Register   Sign In
Code Igniter vs Laravel
#1

Hello guys. 
I'd like to know your opinion on this matter - for what CI is better than Laravel and for what it isn't. 
I started using CI 2 hours ago and I found it very easy to connect it with my small project ( bootstrap, jquery, php, mysql - you know the drill ). I have never used php frameworks before, because I used to make my custom MVC ( which of course is the best choice ), but now wherever I go it seems they want you to know a bunch of frameworks. Don't know the reason behind this, but still. I love the simplicity of the CI and the Documentation provided. I will be often here so I hope I can give my opinion on the community too, but till then I'd like to know more about your choice between CI and Laravel. 
All I hear around the web is that laravel is more sophisticated, more elegant, and more functional in the long run ( for bigger projects ), but all these opinions were based on the fact that CI was dead ( since ellislabs dropped it ). I haven't had the chance to use 2.x or even lower, so...
I saw you had beta ( new ) - 3.0 so I decided - hmm - if it was the most popular one, maybe there is a reason for this. 

Please, let me know what is your "vision" for CI, Laravel, cakePHP and all others in the future. What is your choice and why did you make it. 

Thank you. 
Best regards, g3n1u5;
#2

I think the reason I like CI and have stuck with is its simplicity: what you see is what you get. That, and it's stable and has maintained a consistent API. And a healthy dose of nostalgia, of course.

Laravel has a lot of great features, active community, and it has definitely revitalized the PHP community, but it wasn't for me. Laravel and its community is sort of indicative of a lot larger trends in the PHP community I don't personally care for. There's a lot of purist attitudes regarding 'true OOP' and playing Design Pattern bingo. To me, popular current frameworks like Laravel and Symfony represent an opposite extreme to the spaghettified PHP-4 style code (think Wordpress) that has given PHP a bad reputation. Instead of loose procedural code, there's this seemingly insane trend towards enterprise Java style overengineering and massive bloat in accomplishing relatively simple tasks. The other thing I'm not a fan of is the rewrite culture around these frameworks, how a lot of them don't seem averse to writing API-breaking changes frequently.

That's all well and good, since it's a matter of preference. But, I also see a lot of snarky comments directed at people who stick with frameworks like CI, as if they're a disgrace to the community. It doesn't make sense to me, since CI -- although not super elegant -- gets the job done without a ton of disgusting code. And that's what matters, right?

That being said, there's no reason CI shouldn't be supporting PHP > 5.3 features at this point, as that version is even approaching end of life (or has already, I forget). Granted, it's fairly easy to integrate things like Composer, namespaces, newer language constructs, etc. since CI is so open ended.

Basically, don't worry about what's "cool", since "cool" changes all the time in web dev. Focus on using something that's proven, stable, and fits your preferences/needs. For me, CodeIgniter does that.
#3

I totally agree with @jg6075, your clients/visitators doesn't which framework do you use, as long as your product works. Focus on what you like.
For a lot of projects it doesn't matter if you build them in codeigniter or laravel.

In my opinion if you like to understand and control how your app will react, and you like to build your own model, and use the architecture you like you choose CodeIgniter.
If you like everything out of the box, working like magic, and just put all the libraries like a puzzle, you will choose Laravel.
#4

(11-14-2014, 04:02 PM)jg6075 Wrote: Laravel and its community is sort of indicative of a lot larger trends in the PHP community I don't personally care for. There's a lot of purist attitudes regarding 'true OOP' and playing Design Pattern bingo.

Ha ha ha this just about hits the nail on the head. I have this theory that the profile of an average Laravel developer is someone who is a bit stuffy and up them selves, who has a MacBook and an iPhone. While the profile of an average CodeIgniter developer is someone who is down to earth and free spirited, who has a Windows laptop and an Android phone. OK I'll get my coat...  Big Grin
#5

Oh no. I've got a macbook and an imac, but I do score some redemption points for having an android phone (I hope) Smile

As for the Codeigniter vs Laravel debate. I tend to favour Codeigniter because is smaller and slightly more nimble. There's no right or wrong answer. It's a case of horses for courses.
#6

Things CodeIgniter does better than Laravel

1. It's a bit faster maybe
2. Lower learning curve (not necessarily such a good thing, see the huge amounts of terrible PHP out there.)

Things Laravel does better than CI

1. Routing, big time.
2. Has an ORM
3. Has a templating engine.
4. Abstracts the request cycle
5. Dependency Injection
6. Set up for testing (4+5)
7. Proper CLI support which allows for e.g. work queues out of the box
8. Migrations that work
9. Composer
10. Doesn't abuse globals in the CI style (though there's maybe some sneaky singletons and static calls going on in there)
...

Routing especially wins it for me, CI's router is a bit of joke really. Routing to classes/methods automatically based on the url seems like a good idea until you realise it results in very tight coupling between urls and implementation, which are two things that have no business being together. I think automated routing is bad idea generally as it encourages you not to think about what you are doing.

Because CI predates the popularity of autoloading / doesn't really do autoloading, you have a related problem in how the router actually decides what class to load. It loops through your controller directory, looking for a class name / method name combination it can call. It is limited in how deep this directory structure can go (I think you can go one more dir under controllers without having to rewrite part of the router), and obviously has no support for namespacing. The result is you either get a huge number of classes in the global namespace all sitting next to each other (sort of annoying) or huge classes with huge methods (terribad), because the architecture of the framework neither enables nor encourages splitting things up. You can quickly end up with huge technical debt because the way CI handles the request cycle almost forces you into anti patterns.

Add on top of this the fact that the framework doesn't finish bootstrapping itself until it has decided which controller its routing to and you're ready for a bad time.

I could go on....
#7

Hi all,
i'm new on CI. Still learn many things about CI. I also learned laravel.
but now, I need some framework that have a litle learning curve and more speed when develop some project, and it's all I got in CI
www.arthnugraha.com
Learning by doing
#8

@g3n1u5

CodeIgniter and Laravel are frameworks in the same league in regard of built-in features. IMO they are both minimalistic by intention, this is the dominant culture of their developers and fans. They prefer easy starting.

If you are a "feature greedy" developer, i.e. if you want more out-of-the-box from a framework, you may have a look at Yii2. I think, it is getting interesting after its full rewrite (which was completed about a month ago). However I have not tried Yii2 yet.
#9

(This post was last modified: 11-19-2014, 03:55 PM by dmyers.)

I personally enjoy using CI for the following reasons:

1. It's faster than most "newer" frameworks. You can tell which frameworks use the exact same http request and responds libraries because they are all in the same "block" in any speed test. This means you need more server power to get the same results as CI.

2. It takes very little memory. Again most "newer frameworks" take gobs of memory just to start up this adds to server hosting cost as well as the CPU cost (see #1)

3. I like the CI controller lazy loading. All this add every single route manually stuff is a pain in my opinion. CI supports custom routes if you want to go that way. CI 3 even supports request methods. But, I don't understand why manually adding routes is the latest craze? it's certainly not faster (see #1)

4. Seems Laravel changes it's idea of what's "hot and new" with every release. If you built a Laravel 3 program just 2 years ago when Laravel 3 was "hot off the presses" it wouldn't even be supported today. I Feel bad for the people that wrote books. They were outdated before they even shipped. They are already working on Laravel 5 and from what I understand it's changing stuff yet again. If you need to support an application for more than a couple of years this is going to be an issue.

5. All this stuff about CI not supporting Composer is just crazy? I have been using a number of composer libraries in my CI applications for the past year+. CI 3 includes the composer Autoloader? so big deal CI isn't namespaced?

6. I know CI like the back of my hand. Sure some of the lib's are a little dated but, the core is pretty darn solid. Composer in anything else you don't agree with. The core should be tight and fast in my opinion. Not some bloated 30+ class library.

7. Want a laravel "piece"? Composer it in.

Take it or leave it... but that's my 2 cents... 
#10

(This post was last modified: 11-19-2014, 09:30 PM by thatcode.)

I have tried Laravel, Yii, Phalcon and CodeIgniter, and I found CodeIgniter is so far the best choice for me.

Laravel is elegant, and it has many amazing features as its Blade template engine, Eloquent, Method Injection and so on. But you have to know that all those fancy features will come with a cost, that will be the compromise on framework performance and a steep learning curve. It is easy to use tho, however, if you wanna really understand this great framework or even make some improvements, you need to get yourself well prepared for OOP and design patterns before starting some decent development.

Yii is great, it really has a great balance on both performance and framework architecture design. I have used Yii for several personal projects and it worked pretty well for me. Until the Yii 2.0 being released, oh no... It's still beautiful, but just not as simple as 1.x anymore...

Phalcon is fast, extremely fast. I like the idea that the entire framework is built upon C. Now Phalcon has a new language called Zephir, and the purpose is to eliminate the impediment of writing code in C language for non-C developers. I will definitely use Phalcon for my future projects once the version 2.0 is officially released.
 
Then I found CodeIgniter, a simple and fast framework with well organized documentation. And I'm already on my way for a new project development after a couple of hours documentation reading. It just makes you feel like flying, dude.




Theme © iAndrew 2016 - Forum software by © MyBB