From: Chad Perrin Date: 2012-02-01T12:08:56+09:00 Subject: Re: PHP vs Ruby is it worth it? On Wed, Feb 01, 2012 at 08:48:00AM +0900, Samuel Mensah wrote: > Hi, I've been searching around for what the best language there is out > there that is good enough to start learning if you aim to build a real > time website. From this search, I notice in a couple of spots an > argument between ruby and php and most of the arguments lean in favor of > ruby. I need your opinions and directions as to what I should look at > first, even if it is neither of the two. Please list all the other > necessary languages I will need to know and html being most basic, > please start from there with your list of languages i'll need, from most > basic to the most complex ones i'll need. Keeping in mind that this is unvarnished personal opinion . . . PHP is really easy to start using. It is really easy to continue using badly. It is really easy to use in ways that get you in trouble with software maintenance after your project grows a little. It is a miserable language consisting of an anemic syntax with bolted-on lumps of silly putty mashed into shapes that look vaguely like the facilities of superior languages, but aren't. There are frameworks for PHP that are, in essence, just a way to write PHP with some of the heavy lifting and project origanization already decided for you. A whole lot of PHP development for the web ignores frameworks entirely; the stuff that uses frameworks tends to feel like a cheap imitation of frameworks for Ruby, Python, and even Perl. In fact, most PHP installs use mod_php for the Apache webserver, and expose PHP as a templating engine (in some respects like a web framework that is so lightweight it's not really a framework any longer). PHP is basically not used for anything but web development. Ruby is a beautiful language, pretty easy to start using, a touch less easy to start using well, and very well-suited to writing maintainable code at any scale of project. It has a history of being a bit slow, but this is improving. Like any language, its design has shortcomings, but for the most part it's great, and great fun. Rails is not the same thing as Ruby. It is a web framework that uses Ruby, but uses it in ways that are not the same as idiomatic non-Rails Ruby. It's probably where you'll end up if you do a lot of web development in Ruby in a professional capacity. Ruby is an excellent choice for web development using Rails, using some other framework, using a pretty bare templating engine, or for purposes entirely unrelated to the web at all, in general. I, like many others, used a few other languages for various purposes before stumbling across Ruby. Ruby has mostly replaced them for me, and has entirely replaced PHP for me -- and I try really, really hard to avoid PHP now unless someone is paying me to touch it, in which case I just bite my tongue and get the work done so I can move on to other things. That's one person's take. I hope it helps. -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]