Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

PHP5 Vs. CakePHP Vs. RubyOnRails?

kdawson posted more than 6 years ago | from the please-choose-one dept.

PHP 469

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."

cancel ×

469 comments

Sorry! There are no comments related to the filter you selected.

Sure (3, Funny)

dedazo (737510) | more than 6 years ago | (#20535349)

  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?

Re:Sure (2)

Praedon (707326) | more than 6 years ago | (#20535365)

I completely agree. PHP5 hands down.

Re:Sure (5, Funny)

NickCatal (865805) | more than 6 years ago | (#20535367)

And the award to the quickest troll in the world goes to......

Re:Sure (5, Funny)

Max Littlemore (1001285) | more than 6 years ago | (#20535435)

And the award to the quickest troll in the world goes to......

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 (1)

Anonymous Coward | more than 6 years ago | (#20535879)

Is it possible to give feedback to the slashdot admins to request that kdawson be either removed or limited? I swear to god - every time I see an inane, content-free, pointless article on here lately, it seems to have kdawson as the editor who posted it. It's one thing for cmdrtaco or others to submit a dupe here and there, but kdawson is just a constant source of utter garbage.

Re:Sure (5, Interesting)

dedazo (737510) | more than 6 years ago | (#20535463)

I should probably clarify my original post.

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... (4, Insightful)

jaaron (551839) | more than 6 years ago | (#20535557)

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... (4, Informative)

dedazo (737510) | more than 6 years ago | (#20535653)

In other words, you were trolling.

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:Sure (4, Interesting)

suv4x4 (956391) | more than 6 years ago | (#20535699)

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.

You have the right idea about RoR (speaking as someone who excitedly spent /wasted/ a month learning into it). RoR has some hot ideas but it tries to be too smart and locked down for its own good.

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 (3, Insightful)

Baddas (243852) | more than 6 years ago | (#20535779)

You have the right idea about RoR (speaking as someone who excitedly spent /wasted/ a month learning into it). RoR has some hot ideas but it tries to be too smart and locked down for its own good.


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.. (4, Insightful)

patio11 (857072) | more than 6 years ago | (#20535785)

... when the complaint is similar to "PHP is a really cruddy language to write a graphics driver in". This is true -- using PHP to write a graphics driver is like attempting to change a car tire with a banana, but thats hardly a knock on PHP, its just a mostly banal comment on choosing the right tool for the job. What Rails excels in is choosing the right job for the tool -- given that you have Rails, you now know with pretty good certainty that you can bang out a CRUD site in your target vertical of choice on a very nice timescale while still being feature-rich. That is a really, really nice feature for a platform to have for small software houses.

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 (3, Funny)

speaker of the truth (1112181) | more than 6 years ago | (#20535523)

And the award to the quickest troll in the world goes to......
--
-nick [nickcatalano.com]
Wow, I've never seen such an honest troll before. My hat off to you sir.

Re:Sure (4, Funny)

king-manic (409855) | more than 6 years ago | (#20535383)



      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 (1)

Praedon (707326) | more than 6 years ago | (#20535397)

Oh yeah? Super duper real men code in Python or Perl!

Modders, mark me as a troller if you like, but I'm just filling in the "Missing Options". I would seriously code in CNL (CowboyNeal Language).

Re:Sure (4, Funny)

jamesh (87723) | more than 6 years ago | (#20535441)

Pfft.. Real men code websites in Java and ASP.

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 (1)

king-manic (409855) | more than 6 years ago | (#20535449)

note the sentence after. it's post about masochism not good performance.

Re:Sure (1)

LarsWestergren (9033) | more than 6 years ago | (#20535863)

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.

Funny, but many banks and stock markets run their trading on the Java platform. At JavaOne 2007 for instance, Anna Ewing, Nasdaq CIO talked about handling hundreds of thousands transactions per second with millisecond deadline requirements [ddj.com] .

Re:Sure (0, Offtopic)

outZider (165286) | more than 6 years ago | (#20535429)

PHP is what kids write My First Sites with. Sorry, next.

Re:Sure (3, Insightful)

Bogtha (906264) | more than 6 years ago | (#20535469)

PHP is what kids write My First Sites with.

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 (1)

outZider (165286) | more than 6 years ago | (#20535551)

You do have an excellent point.

Re:Sure (1)

Cafe Alpha (891670) | more than 6 years ago | (#20535715)

There are plenty of very high traffic sites based in PHP. So it is a serious tool.

Re:Sure (2, Interesting)

crayz (1056) | more than 6 years ago | (#20535493)

Can you describe some of your experiences scaling Rails? I'm currently serving up to 250,000 requests per-day with a handful of Rails apps, so I'm wondering where you hit the breaking point and had to switch to the crapfest that is PHP

There's no doubt that Ruby and Rails especially are much slower in execution time than comparable code written in PHP. That said, the PHP code would be 2-10x as verbose, take far longer to write, and be far less maintainable. With Rails you just throw more hardware at it and it will scale as far as you need to. If you're running up against real walls in Rails scaling, try Merb. If you're just a PHP n00b who wouldn't know decent OO-code if it punched you in the face, then by all means stick with the Personal Home Page language

Re:Sure (2, Interesting)

dedazo (737510) | more than 6 years ago | (#20535595)

Can you describe some of your experiences scaling Rails?

I work mostly with ASP.NET, really. Like I said in a later post, I have the impression of RoR being problematic for a lot of people, scale-wise.

There's no doubt that Ruby and Rails especially are much slower in execution time than comparable code written in PHP. That said, the PHP code would be 2-10x as verbose, take far longer to write, and be far less maintainable.

That is a tradeoff, of course, and it's really up to each person to decide the merits of a platform based not only on raw speed.

If you're just a PHP n00b who wouldn't know decent OO-code if it punched you in the face

No, not really. BTW, 250K hits per day is really not that impressive, especially with a "handful of apps". That's ~3 requests per second. I work with a single vertical application that handles roughly three times that at peak times.

Re:Sure (0)

Anonymous Coward | more than 6 years ago | (#20535501)

Perl, Java, JavaScript, MySQL, hand-coded HTML; on Apache, on Linux. Been working for a long time, why re-invent the wheel? Great code base, lots of knowledgeable coders, scares the hell out of coder wannabes...

Re:Sure (2, Interesting)

Cafe Alpha (891670) | more than 6 years ago | (#20535597)

That may change. I'm working on a native code Ruby compiler right now.

It's based (among other things) on the principle that you can optimize to your hearts content as long as you have the ability to de-optimize running code (and data) when something changes and your optimizations are no longer valid.

Re:Sure (0, Troll)

pestilence669 (823950) | more than 6 years ago | (#20535869)

Everybody knows that these are just cheap imitations of dot-net.

... Robots in disguise ... More than meets the eye (3, Funny)

poopdeville (841677) | more than 6 years ago | (#20535359)

Great, a link to a wikipedia article. Wonderful.

Re:... Robots in disguise ... More than meets the (0, Redundant)

McFadden (809368) | more than 6 years ago | (#20535705)

+1 Fucking Spot On

Isn't this just asking for flamewars? (2, Insightful)

Anonymous Coward | more than 6 years ago | (#20535377)

This seems to be yet another kdawson story which exists to solely promote the "my X is better than yours" bashing, trolling and flames that always seem to follow these stories. Come on, can we get a new editor already?

Re:Isn't this just asking for flamewars? (1)

Anithira (1034254) | more than 6 years ago | (#20535411)

Yep. It's like comparing apples to oranges to grapefruits. All 3 have their huge strengths and all 3 have big weaknesses. It depends on the project and how it'll be worked, not the language.

Re:Isn't this just asking for flamewars? (-1, Troll)

Anonymous Coward | more than 6 years ago | (#20535781)

PHP doesn't have any strengths. It's a horrible language pretty much any way you look at it.

Re:Isn't this just asking for flamewars? (-1, Offtopic)

Anonymous Coward | more than 6 years ago | (#20535899)

promote the "my X is better than yours"

Yea, because the whole set-up was flawed from the start - using MySQL when PostgreSQL is better.

Brrrr... (2, Insightful)

jfclavette (961511) | more than 6 years ago | (#20535389)

I can't comment on Ruby on Rails, but PHP (yes, even PHP5) is such an horrible language. Yes, it's widely available and is pretty much the only option out there for free/cheap hosts, but I just don't understand why someone would choose to use it in any serious project.

JSP and ASP.Net (Yes, I know, this is Slashdot) are, IMHO, much more much more powerful and pleasant to work with. If I had to pick amongst the proposed solutions, I'd pick RoR if only for the fact that Ruby is a nice language. I don't know about Rails' features but I could at least trust the language it's built on.

Re:Brrrr... (4, Insightful)

Baddas (243852) | more than 6 years ago | (#20535453)

JSP and ASP are terrible compared to rails. You really ought to pick up Agile Web Development with Ruby On Rails [amazon.com] and go through the sample project at least.

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... (1)

BladeMelbourne (518866) | more than 6 years ago | (#20535689)

That is a good book for picking up RoR and Ruby quickly.

It hasn't converted me from my preference for PHP though ;-)

Re:Brrrr... (1)

Baddas (243852) | more than 6 years ago | (#20535761)

All I can say is, you haven't worked in it enough then. Solve some substantial problems 'the ruby way' and then solve the same thing in PHP. Or try translating a site from one the other... and for extra credit, back again.

Re:Brrrr... (3, Insightful)

BladeMelbourne (518866) | more than 6 years ago | (#20535845)

RoR is a framework, you can't fairly compare it to PHP, which is a language.

Re:Brrrr... (1)

pembo13 (770295) | more than 6 years ago | (#20535623)

Well at least you qualified it by saying in your opinion. Just to share mine, having used PHP and ASP.net, I rather work with PHP for free than be paid to use ASP.NET. I do use both however.

Re:Brrrr... (4, Insightful)

@madeus (24818) | more than 6 years ago | (#20535721)

Compare a straightforward Java class, with try/catch (a silly example, but obviously just to provide some syntax):

public class DoStuff {
    protected double someNumber;

    public setSomeNumber( double number ) {
        try {
            someNumber = number;
        } catch (Exception e) {
            // See e.getMessage() for error
        }
    }
}

... 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) {
            // See $e->getMessage() for error
        }
    }
}

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.

Re:Brrrr... (2, Insightful)

Anonymous Coward | more than 6 years ago | (#20535819)

The problem with java is not the coding, it is the ridiculous amount of hassle you get in deploying multiple apps on a single server. Having to change XML config files buried in archives, ClassLoader problems because two apps need to use the same (or different versions of the same) library. Stupid hassles when versions upgrade which serve no real purpose (moving classes from java.what.ever to javax.what.ever).

Java is great if you work on a single application with its own hosting environment, if you need multiple websites or webapps it quickly becomes a configuration nightmare. I think that is why a lot of experienced java developers seem to really like Ruby, because right now configuration is the single biggest hassle in the development of java websites.

Rails (4, Interesting)

Baddas (243852) | more than 6 years ago | (#20535393)

I've worked in all three, repeatedly, and there's really no contest. Rails is so much easier to get concepts out, and has so many fewer bugs (in my experience), that it's silly to use PHP at this point, unless you have overriding reasons for choosing it aside from inherent qualities.

Re:Rails (2, Insightful)

astrotek (132325) | more than 6 years ago | (#20535459)

ror is good for concepts but I haven't seen any good examples of it in production.

Re:Rails (1)

Baddas (243852) | more than 6 years ago | (#20535503)

Kongregate [kongregate.com] ? That one wins it for me.

Django. (0)

Anonymous Coward | more than 6 years ago | (#20535401)

Django.

I would start a News website built upon... (1, Insightful)

Anonymous Coward | more than 6 years ago | (#20535405)

... real journalists and good standards!

Of course, that's just me.

Errr, this is a new story (2, Informative)

Anonymous Coward | more than 6 years ago | (#20535423)

This is more an ask slashdot post. And even so, CakePHP and RoR are frameworks while PHP is a language.
That being said, CakePHP is fantastic and for anything past simple scripts, I am finding CakePHP speeds up development greatly.

Re:Errr, this is a new story (4, Insightful)

corychristison (951993) | more than 6 years ago | (#20535489)

I agree.

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.

Re:Errr, this is a new story (2, Insightful)

RegularFry (137639) | more than 6 years ago | (#20535727)

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.

Except that in this case, the comparison is valid. PHP without a framework is, if you will, the null framework. Its advantages are that there is no learning curve, deployment is trivial, and there's no runtime framework overhead to heat up your CPUs. On the other hand, it doesn't help you at all in writing the app, and once your site gets beyond a certain size you'll probably end up writing a framework anyway - as it sounds like you've done, after a fashion.

Doesn't it depend on what you intend to do? (4, Interesting)

javakah (932230) | more than 6 years ago | (#20535425)

There are different things that you can do with a website, so first of all it really depends on what you are intending. PHP5 will be great for building creating more traditional websites that are driven by HTML forms, and is probably the best thing to use for such purposes. Ruby on Rails seems to be meant for if you are planning to build AJAX apps. It's fairly easy, with a lower learning curve, but does have scalability issues. Another option that you might consider if you are looking for AJAX stuff would be GWT, the Google Web Toolkit. Larger learning curve, but very fast web apps. Really though, comparing PHP5 and RoR seems kind of like comparing apples and oranges. Just remember, figure out what you are trying to do first, then pick the language.

Re:Doesn't it depend on what you intend to do? (4, Interesting)

AaronBrethorst (860210) | more than 6 years ago | (#20535509)

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.

Re:Doesn't it depend on what you intend to do? (1)

misleb (129952) | more than 6 years ago | (#20535735)

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.


Rails only has a steep learning curve because most people learning Rails are also learning Ruby for the first time. Learning a language and a framework simultaneously is hard. Ruby, by itself, is actually very easy to learn... principle of least surprise and all that. And if you're already know Ruby, are comfortable with MVC, unit testing, ORM, etc, Rails should be a breeze to learn.

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?


Because if all you've known is PHP, learning a language like Ruby can be a revelation. I, for one, didn't want to so much as *look* at another line of PHP, much less write one, after learning Ruby and Rails.

-matthew

Re:Doesn't it depend on what you intend to do? (2, Insightful)

misleb (129952) | more than 6 years ago | (#20535609)

Rails for Ajax stuff? There are WAY better reasons for going with Rails than to get Ajax. A proper MVC framework, for starters. Rails is really meant for building *applications,* not necessarily "sites." If you can frame your site as an application, great, but don't expect Rails to power (well) just any old site.

And, yeah, comparing Rails to PHP5 is kinda dumb because Rails is a framework and PHP5 is a language. The problem with using "PHP5" in any non-trivial application is that you invariably end up building your own framework(s) which can be a huge time sink. Now, comparing Rails and CakePHP would make much more sense. I haven't used CakePHP, but it looks like it has all the major framework features that Rails has. Though being based on PHP is a huge handicap, IMO. PHP is just kind of a dumb language... at least compared to Ruby. Ruby is just an awesome little language. If only it were faster. :-/

the answer: it depends (5, Insightful)

david_bonn (259998) | more than 6 years ago | (#20535447)

Honestly, great websites and web applications have been written using all three of those products. What the best choice for your website will be depends a lot on what your website is. Each of those frameworks makes certain assumptions about how the world works, and you will be happiest with a framework that is closest to your pwn assumptions -- otherwise you'll spend as much time fighting the framework as writing your website.

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.

Re:the answer: it depends (2, Insightful)

Bluesman (104513) | more than 6 years ago | (#20535659)

"but in reality, how often over the lifetime of your website will you migrate to a different database?"

If you told me I could pick either the database to use or the scripting language to code in, I'd pick Postgresql and let you pick the language. Most of the things people try to do in scripting languages can be handled in the database much more elegantly and scalably. Of course, most people don't realize this because they've only used MySQL and don't realize how much it's missing.

If you told me I could pick both, I'd go with Perl, unless I were doing something very simple that's been done a thousand times before.

PHP is decent enough for what it is. Historically there have been security problems with it, and the design is crappy. But it's quick and easy.

I've never used Rails, but it sounds like it does a lot for you. In my experience, that can be a blessing if you're doing something textbook. If not, have fun fighting with the assumptions other people made.

PHP + Zend Framework (0)

Anonymous Coward | more than 6 years ago | (#20535455)

http://framework.zend.com/ [zend.com] end of story.

-mb

Focus.. (3, Interesting)

August Lilleaas (1111117) | more than 6 years ago | (#20535473)

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!

What is all that nonesnse? (0)

Anonymous Coward | more than 6 years ago | (#20535481)

I use HTML(TM).

Django (2, Informative)

son of a submariner (979893) | more than 6 years ago | (#20535483)

Django [djangoproject.com] anyone ?

Re:Django (1)

Gordonjcp (186804) | more than 6 years ago | (#20535593)

Seconded.

Re:Django - Thirdeded (0)

Anonymous Coward | more than 6 years ago | (#20535691)

Thirdeded or second second.

Re:Django - Fourthed (2, Informative)

hpoul (219387) | more than 6 years ago | (#20535745)

imho django is really the easiest web framework to develop in.. It's ORM is flexible and powerful but compared to hibernate & co so much simpler that it is just shocking ..
i have developed in perl, php, java (webwork with hibernate and IoC containers and what-not) but with django you can get things done much faster and get cleaner results..

(and some self-advertising - look at my project http://sct.sphene.net/ [sphene.net] - forum & wiki applications based on django)

Easy (4, Informative)

OriginalArlen (726444) | more than 6 years ago | (#20535485)

PHP5 Vs. CakePHP Vs. RubyOnRails?
Easy - mod_perl [apache.org] .

Re:Easy (1)

adamkennedy (121032) | more than 6 years ago | (#20535769)

Or Catalyst on adaptable drivers (cgi for devel, mod_perl, fast_cgi, cluster for production)...

Django (5, Informative)

Max Romantschuk (132276) | more than 6 years ago | (#20535499)

Given complete freedom, my choice is Django: http://www.djangoproject.com/ [djangoproject.com]

Check out the tutorial, and you'll know why: http://www.djangoproject.com/documentation/tutoria l01/ [djangoproject.com]

Snakes and Rubies (2, Informative)

hitchhacker (122525) | more than 6 years ago | (#20535635)


There was a good video, although outdated (2005), that had two of the main developers of Django and RoR. The video is quite long (3hrs), so I'll link to the Google Video Search [google.com] . The second and third are each person's presentation, and the fourth, which I recommend, is a Q/A session.

-metric

Dive into Python (3, Informative)

hitchhacker (122525) | more than 6 years ago | (#20535749)


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 (3, Informative)

ubernostrum (219442) | more than 6 years ago | (#20535867)

Oh, and be aware, the Django documentation online is for their SVN version!

Well, you can start the tutorial here [djangoproject.com] for the SVN version, or you can read the big warning at the top of the page which links to documentation for the various releases, and find:

So long as you can read large text at the top of every page, and click clearly-offered links, you can read the documentation for dev version, or for any stable release we've ever done.

Re:Django (1)

jnnnnn (1079877) | more than 6 years ago | (#20535793)

I'm involved in a final year undergraduate software engineering project at the moment, to develop a CMS. We looked at Django as well as many others, and finally chose Pylons.

Django is great if all you care about is content; if you want to develop something more flexible, I think Pylons is the way to go as it is far more customizable and powerful (although the two projects are very similar).

Of course, they're both quite young projects, with the associated instability of the APIs.

The best thing about Pylons is that all they're trying to do is integrate (the best) components into one framework: SQLAlchemy, Mako templates, and so on... and you can switch between the competing components easily.

Wrong Criteria, Wrong Problem, Wrong Solution (5, Insightful)

jaaron (551839) | more than 6 years ago | (#20535511)

What about the requirements of the, you know, actual website application?

You've provided no information on the actual website that you intend to develop. That's the important part -- the features and functionality to the customers and end users.

Instead of considering the features of the language and framework first, how about the features of the application? How many users? Who will be supporting it? What kind of server resources are available? Do you need internationalization? What's the roadmap for the site over the next 3 to 5 years? Maybee then you can map the features of the website to the features of the framework or language, such as the maturity of the libraries directly related to your webapp.

But picking the implementation language independent of the functionality of the website is a classic sign of solving the wrong problem. I don't care what you program it in, if you're asking these questions first, you are programming it in the wrong language.

with MySQL, eh... so much for having a choice (-1, Troll)

Anonymous Coward | more than 6 years ago | (#20535519)

Really folks, in any environment where ACID compliance matters (or don't you value your data?), or stored procedures, or decent autocompletion, or easier upgrades to Oracle later, or performance for complex queries - why in the world aren't you looking at PostgreSQL? "LAMP", my ass, I'll take the "LAPP" environment - Linux, Apache, PostgreSQL, and PHP.

MySQL and PostgreSQL each have their advantages - but what I find is that in production environments with mission-critical data, PostgreSQL is often the more questionable choice. Not evaluating both options before making an more informed choice - even if it does turn out to be MySQL - is a mistake.

Re:with MySQL, eh... so much for having a choice (1)

Baddas (243852) | more than 6 years ago | (#20535607)

Amen. Postgres's row-level locking and schema transactions alone make it far superior, I think.

Re:with MySQL, eh... so much for having a choice (3, Interesting)

greg1104 (461138) | more than 6 years ago | (#20535741)

I recently finished a long comparison [postgresql.org] of PostgreSQL and MySQL in the context of mission-critical data that gives a lot more detail on the issues you bring up here.

Tapestry (4, Insightful)

Anonymous Coward | more than 6 years ago | (#20535525)

Or another Java framework, due to the maturity, scalability, availability of libraries, and number of people who know it.

Rails just does not have a stable server. Webrick + fastCGI, or Mongrel, they both crash regularly for us. Also I've had to maintain several Rails apps written by others, and it sucks. All those neat tricks that makes it "productive" for the first programmer makes it difficult to understand and maintain for everyone else.

Python and Django (4, Informative)

egrinake (308662) | more than 6 years ago | (#20535529)

How about using Python and Django [djangoproject.com] ? Python is a much cleaner language than both PHP and Ruby, and Django makes it a joy to build web-sites.

I've been lead developer of a large enterprise system written in PHP for the last few years, and grown increasingly frustrated with just how ugly PHP is. Object-orientation has been tacked on as an after-thought (almost all of the API is procedural, without using exceptions for error-handling), the API is messy and inconsistent, it's somewhat inefficient (has to parse all the code for each request, unless you use an opcode cache), and the syntax is just plain ugly when compared to Python.

Never tried Ruby on Rails, but you should at least give Django a spin before deciding.

Re:Python and Django (3, Funny)

August Lilleaas (1111117) | more than 6 years ago | (#20535677)

Python is a much cleaner language than both PHP and Ruby

...said egrinake, the God that Decides Which Language that Rocks More.

Re:Python and Django (1)

egrinake (308662) | more than 6 years ago | (#20535815)

Python is a much cleaner language than both PHP and Ruby
...said egrinake, the God that Decides Which Language that Rocks More.

I know I'm not supposed to feed the trolls, but at least syntax-wise (and the syntax is basically the language) I'd say it is. I think you'd have a hard arguing that Python has noisier syntax than PHP at least (don't have alot of Ruby experience, but Python code seems easier to read).

Re:Python and Django (1)

August Lilleaas (1111117) | more than 6 years ago | (#20535887)

Yeah, I think we both agree that PHP is uglier than Python =)

I've never written one line of Python, though, so I have no idea. And I was also being a troll-bitch, I guess you also know that one can't say that one language is prettier than the other (unless you're comparing with PHP, of course, harr harr), as it's pretty subjective!

Re:Python and Django (0, Flamebait)

macshit (157376) | more than 6 years ago | (#20535849)

Python is a much cleaner language than both PHP and Ruby
...said egrinake, the God that Decides Which Language that Rocks More.

Seriously.

I've seen a lot of people rag on PHP, but ruby is a fine language. Only a python fanboy would call python "much cleaner" than ruby (come to think of it though, one area where python does win big is in sheer quantity of fanboys... :-).

Re:Python and Django (2, Insightful)

ubernostrum (219442) | more than 6 years ago | (#20535913)

Only a python fanboy would call python "much cleaner" than ruby (come to think of it though, one area where python does win big is in sheer quantity of fanboys...

Yes, damn that Python. I mean, Ruby is so much cleaner. In Ruby, everything's an object! Wait, no, that's true in Python too. But in Python you have to prepend self to talk about an instance variable, that's ugly! Oh, wait, Ruby uses @ and has self for some cases, too. Hm. Well, Ruby's got all that metaprogramming goodness, surely you can't do that in Python! Er, no, forgot about __metaclass__ (which, by the way, doesn't have an equivalent in Ruby -- you have to monkeypatch the class object after it's created), never mind on that one.

Etc., and so forth. Only a "fanboy" would proclaim one language or the other as being inherently superior; in the long run, the biggest difference between the two is idioms (the languages themselves are remarkably similar once you discount superficial syntax differences; see, for example, Python "fanboy" Alex Martelli explaining how Ruby and Python are far more similar than different [google.com] ). And in doing so you've tipped your hand.

PHP5 (2, Funny)

mrjb (547783) | more than 6 years ago | (#20535535)

... because I know it and I know it does the job. Also saves me the work of figuring out what CakePHP and RoR is.

Do your own homework. (-1, Offtopic)

Jacques Chester (151652) | more than 6 years ago | (#20535565)

Seriously. This looks a lot like those "help me do my homework!!11@1!" posts you see on Usenet a lot. Perhaps the original author is doing it for a job, or looking for arguments to win an internet shitfight on some obscure forum. It doesn't matter, he should do his own damn work.

So whatt? There's enough people who actually care (1)

BibelBiber (557179) | more than 6 years ago | (#20535737)

As for myself it's not my homework it's my hobby and I care to read about why people think one is better than the other or what else could be thrown into the game. I think about learning Rails and Ruby so I found it quite interesting to be recommended Python and Django as well. So shut up and let people post here. The intention of Ask Slashdot is obviously not only to answer some persons question but to post a question that might be relevant to many.

Re:Do your own homework. (1)

tieTYT (989034) | more than 6 years ago | (#20535783)

Nothing wrong with asking for the opinions of others, especially when you don't have time to try all the choices you're asking about. After years of programming, I've learned there are some details you don't consider as factors until you've used the language for a long time.

Besides, if the comments on this article are good enough, it will become a great reference for people who ask this question in the future.

you 7ail it (-1, Troll)

Anonymous Coward | more than 6 years ago | (#20535569)

pShitheads. *BsD they want you to CREEK, ABYSMAL since then. More

Have your cake/php/rails and eat it to (4, Insightful)

jalmond (1154263) | more than 6 years ago | (#20535599)

What we have here is another usual question that all really depends on your project type. That being said, I'll try to break from the typical, slashdot format and attempt to address your question:

  1. Maturity of Solution: 1st PHP5, then Ruby, then Cake. Shouldn't be a lot of controversy here. PHP has been around since the dinosaur age, ruby came around with all that slick don't repeate yourself talk and then cake came about and tried to add ruby like framework to PHP.
  2. Features is really going to depend on what your looking for. Rails allows you to write a lot of fairly complex stuff quickly, cake arguably has better built in security, PHP5 will scale better then any of them.
  3. Everybody and their mama knows php5, any new kid thats worth a darn is probably learning rails, and then there's cake, which has nowhere near the dev support of the other two.
  4. Rails wins here if your starting from scratch, but since so many devs already have php experience, complexity becomes sort of relative.
  5. For better or worse, if you were to poll most devs that are building commercial production apps (at least out of the three options mentioned) php5 is going to win hands down. For my company it was a simple decision that hinges on two of the points: scaling and experience. We wanted something to scale to slashdot numbers, while being able to hire a bunch of kids from college to help the dev team build it all. Typical of online startups, we wanted the most bang for the bucks, and php5 was the choice.

P.S. A similar question of Rails vs PHP vs Java question was somewhat subjectively discussed late last year http://www.cmswire.com/cms/industry-news/php-vs-ja va-vs-ruby-000887.php [cmswire.com]

Symfony (1)

demon-cw (162676) | more than 6 years ago | (#20535671)

have you considered symfony [symfony-project.com] ? I've done a few sites for customers using it and it's great!!

Php does no have a good ide (0)

Anonymous Coward | more than 6 years ago | (#20535679)

php does no have a good ide, ruby on rails has netbeans.

CakePHP vs PHP5? This makes no fucking sense. (1)

l-ascorbic (200822) | more than 6 years ago | (#20535703)

CakePHP vs PHP5? Do they think that PHP5 is a framework? Has the name not tipped them off that CakePHP is written in PHP? How can you have PHP vs. "thing written in PHP"?

Re:CakePHP vs PHP5? This makes no fucking sense. (1)

VirusEqualsVeryYes (981719) | more than 6 years ago | (#20535923)

CakePHP vs PHP5? Do they think that PHP5 is a framework?
No. We're not comparing frameworks, we're comparing tools to create websites. You might use a scripting language, or you might use a framework, or you might even use a framework written with said scripting language. One might have preferences according to complexity, prior experience of developers, size of dev community, flexibility, and other factors.

I personally prefer PHP5 to Rails (I have no experience with CakePHP). The latter is great for complex data models and for lots of back-end computation and interaction, at least in the sense that I wouldn't have to code very much. Ultimately, However, I feel more in control with a scripting language than with dynamically created code. This probably has much to do with the fact that I have far more experience with PHP than with Rails, but then again, I'm a purist; I always prefer writing my own code to using someone else's.

How can you have PHP vs. "thing written in PHP"?
Have you ever compared programming in C to programming in Python? That's how.

Plain old C (0)

Anonymous Coward | more than 6 years ago | (#20535773)

You should use plain old C if you want performance.
And you can easily read the HTTP headers with the gets() function - very fast and reliable.

Re:Plain old C (1)

deniable (76198) | more than 6 years ago | (#20535883)

gets is cool. It doesn't even need to be given a buffer size. fgets has to be told how big the buffer is. What's the point of that?

(Actually, unless you wired the socket to stdin, how would you use gets?)

Re:Plain old C (0)

Anonymous Coward | more than 6 years ago | (#20535907)

> Actually, unless you wired the socket to stdin, how would you use gets?
A typical web server will pass the data to the CGI program via the stdin.

If you've used Rails, then CakePHP /hurts/ (3, Insightful)

MBoffin (259181) | more than 6 years ago | (#20535791)

Sorry, can't say much more than that. If you've never used Ruby on Rails, I'm sure CakePHP would be a joy to work in. However, if you've used Ruby on Rails, then CakePHP will hurt. The Ruby language is beautifully suited to this kind of framework, and PHP is not.

This is not to knock CakePHP. In its own right, CakePHP is an excellent framework and a lot of quality work has gone into making it what it is. It's a powerful framework.

The move to this kind of framework can be quite a mind job, whether you're moving to Rails or CakePHP. It requires breaking down very solid foundations of ideas that you've built up over the years on how to build a web application. If PHP is your thing, then weathering that mind job will be all the more easier if you're doing it in a language already familiar to you. But if you're willing to try something new, then it's worth making the jump to Ruby on Rails.

None (0)

Anonymous Coward | more than 6 years ago | (#20535799)

I would choose to not start such a website with or for you.

Your constraints on what to think about have you already treading down the path to failure.

You should just hire a bunch of cheap webmonkeys to code up some php, get decent designer to make it look pretty and spend the rest of your time/cash on marketing and hype. Because your preconceptions make it unlikely you will be part of anything innovative and interesting.

Sorry to be so harsh.

PHP = Assembler of web dev compared to two (1)

unity100 (970058) | more than 6 years ago | (#20535811)

PHP5 is assembler compared to the other two. and not even like assembler compared to c - php5 is actually a everyday usable 'assembler'.

go pro. go php5.

Django. (2, Informative)

imbaczek (690596) | more than 6 years ago | (#20535889)

They all suck anyway, django IME sucks the least.

Nriyh (2, Informative)

Anonymous Coward | more than 6 years ago | (#20535903)

Well I guess it depends what you are building. Ruby on Rails is certainly a fun framework to work with. The trouble is Ruby itself is painfully slow (see http://shootout.alioth.debian.org/ [debian.org] for data on this) and doesn't get Unicode. So if you're site is going to do anything large or international it would be a poor choice. If not then RoR is a lot of fun - go for it.

PHP. People do build large apps in PHP. Having used it quite a bit it remains a mystery to me a)how and b)why. Its ugly and handles state poorly - a disaster for a web language in my view.

Alternatives. Both Java and ASP.NET make sense for large scale applications. Beyond that it depends a lot what you're doing. I would tend to plump for Java since I like being able to pick the right framework for the job I'm doing - so for instance if I'm building a high traffic web app I'd probably go for Struts, if I was building something that needed to be more desktop like I'd probably go for JSF with Seam, and if I was after lots of Ajax bells and whistles I'd probably add GWT into the mix. I also like the richness of the Java toolbox (being able to use JMS to talk to MQ for instance, applets on the client side for certain specific duties), and the Java tools (notably IDEA) are world beating.

language, framework, framework (5, Informative)

fozzmeister (160968) | more than 6 years ago | (#20535925)

PHP5 is a language, the other two are frameworks. So it can't really be compared. The Zend Framework is a very non-limiting non-rigid framework (it's much more like a bunch of really good libraries atm) which might make the comparison viable.

Resistance is futile ? (0)

Anonymous Coward | more than 6 years ago | (#20535941)

For me it has to be PHP5 and Postgresql.

And of course my editor of choice is VI.

But then I can code blindfolded....

Depends what your coders can use though and unless you were to publish the full and detailed specs of your project so we can understand it's scope this entire exercise is a complete and utter waste of time....

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>