3 ms·
CodeIgniter is really not that nice. Maybe it seems cool for the uninitiated, but it is just a PHP clone of Rails. CI and kin can't hold a candle because the ex
by jallmann 16y ago
CodeIgniter is really not that nice. Maybe it seems cool for the uninitiated, but it is just a PHP clone of Rails. CI and kin can't hold a candle because the expressive power of Rails doesn't come from the framework itself, but from Ruby.
There are a few times when the choice between one language over another is more of a pragmatic issue rather than one of taste, and Ruby's ease in creating DSLs (and hence, Rails) is a perfect example.
As TFA mentioned, Ramsus Lerdorf has the right idea. PHP is a templating language. Contorting it into a general purpose language and squeezing a Web framework out of that is unpleasant when there are so many nicer alternatives available. I almost feel bad for Rasmus; people are using his language, taking it beyond its intended scope, and giving it a bad name for that.
- shadowsun7 16y agoCodeIgniter is nothing like Rails - there's little magic involved; the framework is very 'humble' (that is - it almost never forces you to do things its way) plus its entire philosophy consists of giving you classes to work with (and an MVC pattern) ... and then getting out of your way. I'd argue that CI is to PHP what web.py is to Python, or Merb (pre-merge? - correct me if I'm wrong, maybe there's a better example) to Ruby.
- jallmann 16y agoCI is not a carbon copy of Rails, which would be quite difficult anyway given the base language, but the inspiration is undeniable. All the pieces are there -- the MVC pattern and associated features like routes, helpers, etc. CakePHP-Rails would have been a better analogy, but my point still stands. The language plays a large role in making a framework nice to use, as much as the intrinsic design of the framework itself.
- wdewind 16y agoDon't confused "Rails" with "Every web MVC framework out there."
- roel_v 16y ago"the MVC pattern and associated features like routes, helpers, etc" Eh some people (like myself, and my colleagues at the time) were using those concepts in PHP (albeit that 'routes' and 'helpers' were just called 'mod_rewrite paths' and 'utility functions') in 2000, long before Rails was even conceived.
- Periodic 16y agoI'm currently working with Yii. I was pretty sure I was going to go into Rails development, and we were planning on doing the next project in Rails, but Yii is actually very good. It's not built around creating DSLs, it's built around using solid OO principles to build a very extensible system. Yii's use of behaviors (much like mixins in Ruby) allow you to easily encapsulate behavior and share it among many models and projects, and of course it's built on a solid foundation of classes and interactions, including ActiveRecord. I still dislike the syntax a bit, and I understand how the syntax affects the design of the framework, but really it is very similar to Rails.
- damncabbage 16y agoYii is the PHP gateway drug to Rails. :) Once you get the hang of Yii's ActiveRecord implementation (with scopes, behaviors and relations), you're a fair chunk of the way to a) understanding how to use Rails' version effectively, b) coming to loathe CodeIgniter, Zend Framework and CakePHP for not providing similar functionality.