Why Isn't Ruby More Popular than PHP?

I remember a few years ago, oh the shouts of Ruby will replace PHP, was never going to happen. PHP is accessible and very easy to learn and once you do you can easily learn other languages. Not the same story with Ruby, the Rails framework is popular, not the language. Now we have Active Record everywhere else, no need to learn Rails or Ruby.

@NetNerd85

It’s true. And they’re still saying that in the Ruby realm. I never cared, and still don’t because PHP has always very good to me, as well as the PHP community. The Ruby and RoR communities however are snooty and condescending (actually it’s only the hardcore Ruby and RoR fanboys who are arrogant and self-righteous). It’s a shame because they give Ruby a bad name, and it’s a great language.

As far as PHP going anywhere, it’s only getting more and more popular as time goes on. The RoR folks consistently trash PHP and it’s proponents, as if they are unenlightened, brain-dead primates if they program in PHP. But PHP is a fantastic language, especially when you really study up and realize how much you can accomplish and how powerful it is.

Most programmers (especially those who put it down) haven’t even scratched the surface of discovering what PHP is capable of, and it’s development is always growing and improving faster than any other language. PHP is incredibly popular for a reason, and not for the reasons the RoR folks would have you believe. It’s popular because it’s still the most used, versatile, stable, documented, fastest growing, and all-around best programming language for the web, period!

You CAN compare Rails with PHP. They are both tools (to use a broader term) to develop web applications. What the commercial is saying is that developing with Rails can save you a lot of headaches PHP would cause. There is nothing wrong with that, considering that a great number of websites/web applications used to be developed with PHP alone, without any additional frameworks.

So please, stop saying the same thing over and over again.

RoR is generally better for more complex applications, with more complicated data models. E.g. many startups use RoR. PHP is better when you want to quickly add some programmatic logic to your site.

When PHP 3 rolled out, it was a pretty terrible language. No OOP to speak of; hundreds of functions in the global namespace; inconsistent naming; registered globals; magic quotes; mixing logic with presentation; bad or no multibyte characters; strange type coercion; and probably many more issues I’ve since forgotten about. BUT… it was super easy for people with no programming background. They could build contact forms, blogs, forums, etc., with little knowledge of security issues and no knowledge of design patterns. (If you can, take a look at vBulletin’s 3.x code, and be ready with a barf bag. WordPress 2.x is also pretty sickening under the hood.) I think the most significant factor in PHP’s rise to fame was its appeal to the large population of aspiring non-programmers.

Today, PHP is a lot better. Now we can write code that is Java-esque. Ruby, I’m sure, is also a good and fully featured programming language, but I think it’s going to remain a minority language for two reasons: PHP already has a strong foothold, and because Ruby’s syntax tends to look foreign to people accustomed to C-style syntax.

This is probably the BEST post in this entire thread. Well said.

Today, PHP is a lot better. Now we can write code that is Java-esque. Ruby, I’m sure, is also a good and fully featured programming language, but I think it’s going to remain a minority language for two reasons: PHP already has a strong foothold, and because Ruby’s syntax tends to look foreign to people accustomed to C-style syntax.

Agreed. It’s a lot better today in 2012. The OOP side of PHP is fantastic. Most programmers are afraid of change and do not want to leave their comfort zone. They don’t have the interest (or time) to learn something new. This is why they continue to exclusively use the procedural side of PHP. They will dabble in OOP PHP, and insist it is overkill, and return to procedural programming. This is because they only “dabble.”
Many who refer to PHP as being antiquated and messy only know about the procedural side of PHP, or what little OOP PHP they know is due to using a Framework. However, I urge people to not just dabble, but seriously learn and master the Object-Oriented side of PHP (not just minimally, like when using a Framework). I think most would have a totally new appreciation for PHP, not to mention that the future of OOP PHP is very bright indeed. PHP will always be dominant. Ruby has had just as many years as PHP to ripen, but it never does (it’s just as old as PHP). People have been saying it’s the way of the future year after year, but it’s never gone anywhere, and it never will (maybe because the Ruby and RoR community is … well, never mind :rolleyes: - you reap what you sow). PHP is the future, especially Object-Oriented PHP - and it’s getting better and better at an exponential rate.

This means that many people are using PHP…

90% of the web uses PHP. By comparison, only 2% use Ruby (actual Ruby stat). I just wanted to encourage people to try/use the Object Oriented side of PHP because it is fantastic. Anyway, if you are trying to decide which language to learn - from a practical, financial, and productive point of view, PHP is the language you want.

Do you have any manuals on OOP on the PHP? I’d like to learn more about that…

@joseninogarcia

As far as books, most OOP PHP programmers recommend: “Objects, Patterns, and Practice” by author Matt Zandstra, which is a great book. But I think “Object Oriented Solutions” by author David Powers is by far the best of the best. It’s range is absolute beginners all the way to professionals. It’s all you would ever need on any level, it’s written brilliantly by a great teacher (not just a great programmer), and everything is crystal clear - you’re never lost.

As far as online manuals, I’ve never seen any that you would learn much from. Good for reference, but not for actually conceptually learning and mastering the skill.

There are some great PHP videos on Lynda.com and Killer.php, including OOP PHP. They’re not free, but they’re well worth the small amount they charge. It’s a steal for the unbelievable amount of high quality material and fantastic teachers on those sites.

All in all, if you don’t mind reading, the books I recommended are the way to go if you want to thoroughly learn it inside out.