To read all comments associated with this story, please click here.
I agree with this as Ruby on Rails is a framework and PHP is not(be aware that I'm generalizing a little). I would like to see the future as RoR+JS+Postgres(note: I barely use RoR but my limited experience was positive enough that I'd really like to ditch PHP and based on what I've heard from other people it's a good way to go).
Just that you don't think there isn't any information on Ruby on Rails, I give you:
http://www.onlamp.com/lpt/a/5546
http://www.onlamp.com/lpt/a/5641
No but seriously, don't do it. There are mutch beter solutions to web programming then PHP.
Why don't you provide some examples instead of linking to someone else's rant site?
(my guess is because you're unoriginal and simply get YOUR opinion from someone else's)
The author of said article says things like:
$a = array(array('foo' => 'bar'));
foreach ($a as $item) {
$item['new key'] = 'new value';
}
print_r($a);
This, of course, changes $a not at all, because the assignment to $item is a deep copy. (It's also slow as hell if the items you're deep-copying are substantial.) The workarounds for this are truly ugly.
This changes completely in PHP5, which is a good thing, unless you're trying to upgrade an existing body of code. That's not a small "unless;" if you weren't using PHP4, there's really no excuse to start out in PHP5 instead of Spyce or CherryPy or Rails.
This would leave you to believe that in PHP5, when you do a foreach it behaves differently and is backwards incompatible with PHP4. This is most definitely not the case.
Also the author seems to throw around data structures like he knows something, and he may well, but he doesn't know ANYTHING about PHP internals. He hasn't researched them, he's just guessing. When he talks about "deep copies" in foreach loops, he's 100% wrong.
PHP uses "copy-on-write" with references so when you loop through a large array of data it is in fact looping over THAT VERY ARRAY, it's just that on WRITE a new variable is instantiated as a copy. The performance on foreach()'s is just fine.
Really, the only major difference between reference passing in PHP5 is that Objects are passed by reference by default now, which was not the case in PHP4.
Also, 99% of my PHP4 code has always been compatible with PHP5, even if it does raise some "strict" notices.
The author of that article obviously doesn't know PHP as well as he thinks he does, and I would wager neither does the original poster.
Actualy I started with PHP, wan't to bad wasn't to good. But over all not my thing, tried to CherryPy since Python is my main langauge, nice but with something like 20+ frameworks geting hosting set up suckes and I haven't found one for me yet. Looked at Ruby, interesting language, heared about Ruby on Rails, might use it, heared about the AJAX layer that dose the Javascript for me SOLED!!!!
I've got my reasons to chose what I chose. I like the beter is beter tool set. You like the worse is beter. Good for you, you think I'm an idot good for you, you think I care...
PHP certainly doesn't scale as well as Ruby on Rails, etc., but it isn't entirely worthless. On the contrary, I've found it rather useful for simpler tasks (though there's some overlap here with newer, ugly W3C technologies) and for XML parsing. Other solutions certainly are superior for larger tasks, but PHP has a niche.
The farthest I've gone with Ruby was installing the interpreter once, so don't take this as scientific fact or gospel or anything.
The main (and probably most significant) difference between PHP and Ruby is that 99.9% of the hosting companies you can use out there support PHP. I don't know what Ruby on Rails support is like, but I'm guessing it is significantly less.
Most people who learn PHP do so for simple, dynamic web sites. They aren't creating web-based space shuttle diagnostic software with it. PHP scales just fine for most of the things people throw at it.
Syntax! People get used to everything looking like C they gloss over the exeptions.
Ruby:
http://rubyforge.org/cgi-bin/viewcvs.cgi/freeride/freebase/lib/free...
PHP:
http://cvs.sourceforge.net/viewcvs.py/phpmyadmin/phpMyAdmin/librari...
So, what would you rather look at for long periods of time?






Member since:
Whatever you do don't learn PHP. It's now worth it, LIVE! No but seriously, don't do it. There are mutch beter solutions to web programming then PHP. What's so bad? Well for starters read this:
http://spyced.blogspot.com/2005/06/why-php-sucks.html
You can fined lots of other rants if you want to. I would recomend Ruby on Rails, not only can you avoid doing any back end PHP, you can also avoid doing any frontend JavaScript!