What Are They?
Firstly, these two big players in the current web development arena are not in the same category. But are often compared when deciding which one is best and which one to use etc.
Developers who are already using Ruby on Rails are singing it’s praises and it is definitely becoming more and more popular. The elegant, robust framework, with solid foundations and strict coding philosophy forces you to write high quality applications that are extremely powerful. Hulu, Airbnb and Basecamp are all created using Ruby on Rails. There is no doubt that learning Rails can be extremely beneficial. Companies are beginning to stand up and take notice of how powerful the framework is and are looking out for talented Rails developers. Rails whiz kids are currently in demand with companies willing to pay high prices for their services. If you put the effort into learning Ruby on Rails you will eventually reap the rewards.
PHP was created in 1994 by Rasmus Lerdorf and has played a huge part in websites over the last 10-15 years. CMS’ WordPress and Drupal are built using this scripting language. Around 25% of todays sites are built with WordPress making it a language definitely worth learning. Knowledge of PHP would give you the opportunity to edit WordPress themes and plugins and even make your own. Themes and plugins for WordPress are being created every day due to the high demand for them. With PHP under your belt, you can be a part of that high demand.
If you want to learn Ruby on Rails, be prepared for it’s complexity. It is not easy to learn. How quick you can learn it depends on how much time you have to dedicate. I would say 20 hours a week for around 6 months would give you a solid understanding and basis to put your knowledge into practise. Without a shadow of a doubt, Ruby on Rails is definitely the most difficult of the two to get your head around. The whole framework of Rails involves many languages, all of which you will have to learn and get to grips with. It is object-oriented from the ground up with strict rules and a need for concise code. If you are a newbie to world of web development, Rails isn’t the best place to start.
PHP is relatively easy to pick up and begin putting into practise in minutes on your HTML code. It is also relatively simple to deploy with hosting services using the LAMP environment (Linux, Apache, MySQL & PHP). You don’t require in-depth knowledge of the web stack.
PHP has reams of resources available as it is often used in todays web development industry. You will find libraries of documentation to help you on your way to becoming a PHP master. There are many developers you can speak to and ask for advice on forums etc. Ruby on Rails is becoming more and more popular and developers are increasingly becoming acquainted with it but at the moment PHP leads the way in terms of resources available. If you are interested in learning more about Ruby on Rails I highly recommend talented designer and developer Mackenzie Child. His youtube videos will have you building web applications in a few hours.
Long Term Development
The fact that PHP has such a shallow learning curve means developers can get away with using sloppy code. This becomes an issue in the long term when you want to upgrade your site or application that was built with bad coding practises. You could say this lies with fault of the developers rather than the language itself but it’s PHP that allows such sloppy use. The plus side of having your project coded using PHP is that there are many developers out there who can upgrade your site or application at a relatively low cost.
Ruby on Rails makes use of ‘Gems’ that add functionality and accelerate development and maintenance. Rails is becoming a popular choice for projects with long term plans. I predict more and more projects will be created using Rails in the coming years.
Both technologies play a prominent role in todays web development industry meaning neither can be ignored. It would be personal preference as to which one would be best to use for a certain project. It depends on the developer.
My advise to coding beginners would be to start off learning PHP due to the shallow learning curve and the short time it takes to get to grips with. Build up your confidence and experience. Then maybe start looking into learning Ruby on Rails after you are comfortable with PHP. PHP is a good entry point for beginners to begin their career. Ruby on Rails on the other hand is more for experienced developers. The truth is there are plenty of developers all trying to succeed with PHP making the competition quite high. So learning more than one language is always going to be the best way forward.
After you have gained knowledge of PHP and Ruby on Rails, you would be in a great position. Not only can you charge more for your Ruby on Rails projects but you can also choose which technology to use for each project. PHP would be best to use for CMS projects in WordPress or Drupal and Ruby on Rails may be more suited to larger, more complex projects.
Both technologies are big players who are here to stay!