Slashdot Log In
PHP5 Vs. CakePHP Vs. RubyOnRails?
Posted by
kdawson
on Mon Sep 10, 2007 01:38 AM
from the please-choose-one dept.
from the please-choose-one dept.
OldJavaHack writes "If you could start a website (with MySQL for persistence) from scratch and you had a choice of PHP5, CakePHP, or RubyOnRails — which would you choose and why? Things to consider in your decision: 1. Maturity of solution; 2. Features; 3. Size of community of skilled users (to build a team); 4. Complexity/ease of use (for neophytes to master); 5. Greatest strength of your choice, and the greatest weaknesses of the other two. Here is a comparison of capabilities."
Related Stories
This discussion has been archived.
No new comments can be posted.
PHP5 Vs. CakePHP Vs. RubyOnRails?
|
Log In/Create an Account
| Top
| 469 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Sure (Score:3, Funny)
(Last Journal: Friday August 31, @07:08PM)
Next?
Re:Sure (Score:5, Funny)
(http://www.nickcatalano.com/)
Re:Sure (Score:5, Funny)
kdawson, for posting this absolute shit as an IT story with nothing more than a link to a wikipedia article in the summary!
Congratulations!
Hey, kdawson, while you're reading this, can I just grease you up about a story I want to post about how Steam will replace electricity to power the electric kettles of the future [google.com]? Thanks buddy!
Re:Sure (Score:4, Funny)
(http://www.fokke.net/)
Re:Sure (Score:4, Funny)
Re:Sure (Score:5, Funny)
Re:Sure (Score:5, Interesting)
(Last Journal: Friday August 31, @07:08PM)
I've never used Ruby or RoR, but my impression of it seems to be one of great expectations and not a lot of delivery. I've read way too many blogs by people who built web sites with RoR only to have them crash and burn under load. Also, the language itself seems to place a lot of importance on clever syntactic sugar, which being an old fart I automatically dislike.
Now, "scale" does not mean the same thing to everyone. There's Digg and Wikipedia, and then there's the vertical business app that gets 200 hits per day. RoR might be a good choice for the latter, not so good for the former.
Also, although my experience with PHP is limited as well, it seems to me that it's a mature enough platform with a good runtime (that tends to be confusing at times) and a *massive* user base. The amount of readily available PHP code out there is amazing. It will take Ruby quite a few years to get to that point, I think. So maybe Ruby is not a good beginner's environment, application-wise. But that's just my perception of it. PHP is more to the point. On the other hand, RoR might be more mature and stable than CakePHP, just because it's been around longer.
The best tool for the job and all that, you know?
Oh... and BTW, first post =)
In other words... (Score:5, Insightful)
(http://www.cubiclemuses.com/)
I've never used Ruby or RoR... my experience with PHP is limited as well...
In other words, you were trolling. :-)
Having done websites in PHP, Rails, Python and Java, I can say that they all suck one way or another. Ruby and Rails are both very different from PHP and my personal unconfirmed suspicion is that a lot of the Rails problems people have are from programmers who jump over into Rails without first learning what they're getting themselves into. Deploying Rails can be very difficult and you can face a lot of issues that you would never face for PHP.
Personally, I prefer Python or Ruby over PHP any day.
Re:In other words... (Score:5, Informative)
(Last Journal: Friday August 31, @07:08PM)
Nope. I know enough about high-scaling distributed applications to be dangerous, since that's what I do for a living. I know PHP runs sites like Wikipedia and Digg, among others. I know I've never seen a blogger go on record to complain about PHP not scaling as he expected, while for RoR that sort of thing seemed quite common in the last year and a half or so.
Yes, your execution can suck and so it won't really matter what language or stack you use. But the impression I have of RoR is that it falls apart a lot faster than PHP under comparable loads. Maybe the crappy internal design PHP suffers from might be an advantage in this case, because Ruby is designed better but it seems to suffer from classic bottom-heavy OO problems you see in other languages.
Ultimately the person who submitted this might be building an accounts receivable app at a little company that gets three hundred hits per day, so it won't really matter if he writes it with Ruby, PHP or Malbolge.
Re:In other words... (Score:5, Interesting)
Hell, even the Ruby, and Ruby on Rails site http://shiflett.org/blog/2006/feb/php-easter-eggs [shiflett.org]> need PHP in order to scale
Re:Sure (Score:5, Interesting)
You have the right idea about RoR (speaking as someone who excitedly spent
CakePHP is a typical PHP open source project: random code, bloated, no direction. It's also cool, in a way, but I'd never run big project on it.
One promising framework for PHP appeared to be Mojavi, but it later stalled and was forked into Agavi. Agavi tends to try to be way too flexible for its own good (unlike RoR), and in the end is just not simple to use. There's just too much stuff in there you'll never use in a real world project, which complicates code understanding and development.
I also find the "CakePHP vs PHP5" question to not make any sense, I'm sorry.
Re:Sure (Score:4, Insightful)
(http://illicittech.blogspot.com/)
The beauty of Ruby is, even if you don't like it the way they do it, you can always monkey patch it. Open up the object and override the method(s) you don't like.
Try doing that to the PHP core libs. Better know C, and love it a lot.
It makes little sense to say Rails doesn't scale.. (Score:5, Insightful)
Granted, I wouldn't write Digg in it, but *I'll never write Digg in anything*. Neither will 99% of the world's programmers, and for the 1% that are making social networking sitse with desired user numbers the size of nation states, they have the LAMP stack and God bless them for it.
As for me, I've got one quite profitable desktop application written in Java (folks laughed at me for that -- what can I say, it got the job done) and am having a bloody ball working on a small business vertical app which, at $15 / account / month and low predicted need for users to interact with the app, would replace my day job income at about three dynamic page hits per hour. I have this funny feeling that Rails will scale that far.
Re:Sure (Score:5, Insightful)
You could, you know, link to those "way too many blogs" and thus let the rest of us decide for ourselves if this is incriminating evidence against Ruby.
"I read it on a blog" does not in any way imply truth.
"I read it on many blogs" doesn't really make it much better.
And until then, you shall remain a troll. After you post the links, you'll have your status upgraded to "person with an opinion, willing to discuss".
Re:Sure (Score:5, Informative)
(Last Journal: Friday August 31, @07:08PM)
Is that specific enough for you?
Would you like some salt to go with your crow? Let me know.
Twitter Follow-Up (Score:4, Insightful)
(http://www.cubiclemuses.com/)
And there's a good follow-up [romeda.org] by one of his coworkers:
We've been extremely happy with Rails, and make use of the multitude of helpers that it offers us - like any application on any stack, though, providing fast response times to a (rapidly) growing number of users is a challenge. The solutions are often tightly coupled to the application and its characteristics, and while scaling the most trafficked Rails site in the world, we've run into situations where existing solutions weren't enough.
Rails is best at database baby-sitting, which is not what Twitter is about and it's understandable they would have issues. Ruby is slow and we need a good virtual machine. Nevertheless, Twitter does run on Ruby which shows that it can be made to scale. Not that Twitter is a good measure of anything other than, well, Twitter. And I'm sure someone could have done it with PHP, Python, Erlang or C.
Which is always why blanket statements about languages and platforms is always a bad idea. Just look at the comments on this article. It's just a chance for everyone to trumpet their favorite web framework or language. Sure we have our favorite tools, but most of them suck at one thing or another.
Re:Sure (Score:5, Interesting)
(http://knewter.wordpress.com/)
Well, you can get specific like that, yes. But please, follow the story to its completion [sharedcopy.com]. The issue was solved, and easily solvable from day one. (For a better solution to the same problem, see this link [drnicwilliams.com].)
I currently write chronically non-scaling Rails apps myself. I can write apps in Rails that scale well, but it turns out there's a huge market for sites that don't need to, and that's where I'm spending some time these days. I've also worked on a nicely-scaling social network site in Rails. There are plenty of tutorials on how to make sure your Rails app scales, but here are the things I'll have to do to my company's custom CMS to make it scale:
Oh noes! The horror! Then it's up to Apache to handle pretty much every request. Of course, my use case only has to make static content scale. As long as you're actually writing nice stateless apps on the web, in whatever language, they'll scale. If a given URL has static content across visits, they'll scale insanely well, because you don't Mb>use RoR to serve the site in those cases, you use Apache.
Re:Sure (Score:4, Interesting)
(http://www.andrewvc.com/)
PHP is comparable to Ruby or ModRuby. Ruby on Rails is a framework.
Of course there's no scaling issues with these languages because they're just programming languages. Things like load balancing are something YOU have to take into account as you build your website and manually handle. You can architect things anyway you want, so if stuff fails it's your fault. This means DB transactions, sessions, templating, etc. are all things you have to handle. The language can't be at fault for these things.
Ruby on Rails is slower for many things because it saves you upfront development time and makes refactoring and adding features a breeze. For many people this is perfectly fine. I write intranet apps for my company in RoR all the time, and it's great. We do not handle many users, but we DO care about getting functionality fast.
Also, for some ridiculous reason people seem to think that RoR does not scale because an out of the box RoR stack may not scale perfectly (like Twitter). RoR may be slower than a tuned PHP script in some cases, but it scales horizontally just fine.
Lots of people may think Twitter and say RoR doesn't scale. But what they don't know is that twitter didn't scale because their DB didn't scale to handle that many writes. You can always throw more boxen at rails and get a larger pool of Rails processes to distribute the load to. You can throw Memcached at it to speed up queries as well, but at the time the whole Twitter complaint happened Rails only supported one database connection. This was fixed soon after. The fact is though, that once you have a service with so many reads and writes like twitter, out of the box ANYTHING is going to suck. Rails, however, gained the necessary functionality (Magic Multiconnections) and allows for all the custom tweaks, performancing tuning, and caching you'll need.
Re:Sure (Score:4, Funny)
--
-nick [nickcatalano.com]
Re:Sure (Score:5, Funny)
(http://www.legalresourcecentre.ca/)
1. PHP: What people build real websites with.
2. RoR: What people build websites with because they want to be kewl and later switch to PHP when they realize it simply does not scale, complete with acerbic "I wanted to believe" blog entry and everything
Next?
Pfft.. Real men code websites in Java and ASP. Scalability and performance are for pussies. My server to chugs at 10 hits/minute and it likes it.
Re:Sure (Score:5, Funny)
I think Real Men would be more likely to build the web server and TCP stack into their web sites, for performance reasons.
At least that's what we did in my day.
*cough*
Re:Sure (Score:4, Funny)
Re:Sure (Score:4, Insightful)
Seeing as "Our team is familiar with..." plays no part in this decision whatsoever, I'd say that we are dealing with kids writing Their First Site. Or, looking at the peculiar phrasing and noting the date, kids who have just received their first homework assignment for a project that requires them to submit a plan first.
Re:Sure (Score:4, Interesting)
(Last Journal: Friday August 31, @07:08PM)
Well, I "checked" Twitter [radicalbehavior.com]. Are the authors of the other ones also on record saying the technology they chose fails to scale?
Re:Sure (Score:5, Informative)
(http://www.kibbee.ca/)
... Robots in disguise ... More than meets the eye (Score:3, Funny)
Re:Brrrr... (Score:5, Insightful)
(http://illicittech.blogspot.com/)
It'll change the way you think about development for the web.
Or, if you're really set on Java, try Rails for Java Developers [amazon.com] and you'll see how much more concise the exact same code is in Rails.
Re:Brrrr... (Score:5, Insightful)
public class DoStuff {
protected double someNumber;
public setSomeNumber( double number ) {
try {
someNumber = number;
} catch (Exception e) {
}
}
}
... with some PHP for the same code, which would look like this:
public class DoStuff {
private someNumber;
public setSomeNumber($number) {
try {
$this->someNumber = $number;
} catch (Exception $e) {
}
}
}
I don't see how that's wacky syntax in the slightest. Just people people use PHP like it's Perl+Mason doesn't mean you can't use PHP for serious, scaleable, enterprise software. I know from experience that people are just as likely to write nasty Perl, Ruby or ASP as they are nasty PHP.
Personally I think Java makes it more difficult to be wacky (even though of course it can't force people to write code that's ultimately good) and that has definite benefits in an enterprise environment, but that lack of flexibility (which scripting languages like Perl and PHP have) is also why I don't tend to want to use Java.
Rails (Score:5, Interesting)
(http://illicittech.blogspot.com/)
Re:Errr, this is a new story (Score:5, Insightful)
Lately people (aka: script kiddies) seem to be losing the distinction between what is a language, and what is a framework. I cannot remember the last time I downloaded a PHP script and it required PEAR. I absolutely despise PEAR, and all other frameworks that really don't seem to have a place.
Over the past 5 years or so (I develop websites for a living) I've developed a framework-style setup that I use for all new projects. Most sites don't share the same code as I develop project-specific. But the structure is the same, and in most cases I could grab a pile of files from one site and plop them in the next and it would work.
Use the tool as it is meant to be used. PHP is a language. A framework is a framework. Please don't compare them on the same level.
Doesn't it depend on what you intend to do? (Score:4, Interesting)
Re:Doesn't it depend on what you intend to do? (Score:5, Interesting)
(http://blogs.msdn.com/aaronbrethorst)
I disagree. Rails is fantastic for quickly rolling database-driven forms apps. It includes some nice helpers for quickly integrating asynchronous behavior (Ajax), but it's certainly not mandatory. PHP5 doesn't include an OR mapper, and nor should it; an OR mapper should be part of a separate framework or library (just as it is with Ruby and Ruby on Rails). I think that Rails actually has a fairly steep learning curve. It has *very* specific ways of handling most things, and trying to fight against these things will only come back to hurt you in the end. Additionally, since it requires you to function in an MVC mode, there might be an additional bit of learning present as you figure out how to properly separate your app into presentation, model and controller layers.
At the end of the day, it all comes down to need and experience. If you know how to use PHP, why not use it? If you have to integrate a new feature into an existing Rails app, then you'd better learn Rails in a hurry. Personally, I'll build Windows server-targeted web apps in ASP.NET because I know the tooling and the backend. If I'm hosting on Linux or UNIX, I'll write it in Rails because the language and frameworks are so much nicer to use than PHP.
the answer: it depends (Score:5, Insightful)
(http://www.chewuch.tv/ | Last Journal: Thursday December 12 2002, @05:39PM)
Any halfway skilled programmer will be able to do useful work with any of those frameworks fairly early on, but all of them are also very rich environments, so there's always more to learn.
I've written web apps in an ungodly tangle of PHP4 and PHP 5 and Perl and using Ruby on Rails. Currently Ruby on Rails is in favor, but is far from perfect.
Probably most of my frustration with Rails and PHP 5 has to do with Active Record. My big gripes are: (1) Schemas, entity-relationship diagrams, and queries tell me how an application works -- with Active Record this information is strewn across a whole bunch of files (especially in Rails); (2) Database-independence is a nice idea, but in reality, how often over the lifetime of your website will you migrate to a different database? Usually your database is chosen for you. Usually a switching databases involves coordinating with a lot of people who you'd usually rather not have to deal with -- those issues will take far more time and energy than differences between MySQL and Oracle; (3) a pretty common design pattern for web pages is to have a form that let's you fill in a few parameters (date, maybe geographical information) into a huge multi-table select statement -- you can do that in Active Record, but basically all you gain is a marginally fancier wrapper than you would have with DBI.
Focus.. (Score:3, Interesting)
(http://august.lilleaas.net/)
May I remind you all of this:
http://www.flickr.com/photos/planetargon/1279842 54/
Yes, that's the creator of RoR talking about what he feels about other people not liking his framework. RoR is all about pretty code, if you don't like RoR, use something else.
So, that sorted that out. Now, troll!
Easy (Score:5, Informative)
Django (Score:5, Informative)
(http://max.romantschuk.fi/)
Check out the tutorial, and you'll know why: http://www.djangoproject.com/documentation/tutori
Dive into Python (Score:4, Informative)
(http://www.debatepoint.com/)
Whether it's Ruby on Rails, or Django, most developers will have to learn a new language. Python has a book available online: Dive into Python [diveintopython.org]. I found it very easy to switch from C/C++/PHP to python. Django does have a slight learning curve though. Oh, and be aware, the Django documentation online is for their SVN version! Most likely NOT your distro's version. They are still under heavy development.
-metric
Re:Dive into Python (Score:4, Informative)
(http://www.b-list.org/)