dans La techno

Very interesting article by Derek Sivers : 7 reasons I switched back to PHP after 2 years on Rails.

Interesting… The guy invested 2 years to redevelop his PHP site in Rails, and after these 2 years, he decided to rewrite everything in PHP again.

Citation:

I didn’t abandon the rewrite IDEA, though. I just asked myself one important question:

“Is there anything Rails can do, that PHP CAN’T do?”

The answer is no.

I threw away 2 years of Rails code, and opened a new empty Subversion repository.

He took the best ideas of Rails, and applied it to PHP !

Citation:

It’s the most beautiful PHP I’ve ever written, all wonderfully MVC and DRY, and and I owe it all to Rails.

Inspired by Rails:

*- all logic is coming from the models, one per database table, like Martin Fowler’s Active Record pattern.

*- no requires or includes needed, thanks to [url;=http://www.php.net/autoload]__autoload[/url].

*- real MVC separation: controllers have no HTML or business-logic, and only use REST-approved HTTP. (GET is only get. Any destructive actions require POST.)

*- all HTML coming from a cute and powerful templating system I whipped up in 80 lines, all multi-lingual and caching and everything

*- … and much more. In only 12,000 lines of code, including HTML templates. (Down from 90,000, before.)

Again, interesting because this very similar to what we are doing with our SmartObject Framework

Recent Posts

Leave a Reply