In today’s technology centered environment, there are often clashes between PHP and Ruby on rails programmers for their language supremacy. People should have a clear idea that PHP is a language and Ruby on rails is language over a framework. So, comparing PHP Vs Ruby on Rails wouldn’t be ideal one. However, I have tried to provide few insights on this comparison. Most interesting talks these days in tech world is PHP replaced perl and now it is more likely ROR would replace PHP. I would certainly disagree with these, as PHP has been built to overcome difficulties based by programmers in perl. Similarly ruby in rails is built by programmers after drawbacks in languages PHP, ASP and perl. PHP growth rate is stagnating for the past few years, whereas Ruby on rails has been growing tremendously. It is mainly because most developers want to be more sophisticated in their development. Below are a few general differences. Application performance: PHP coding runs faster than that of Ruby on rails code. However, we can achieve tasks in ROR with few lines of code compared with that of PHP coding. Web hosting: Most of the webs hosting companies do support PHP applications, whereas Ruby on rails would be supported only by unix based server. Still Control panel for Rails 3.0 framework have not been implemented. On hosting front, PHP is clear winner. With introduction of Heroku, ROR applications can be hosted easier. Testing: In PHP, testing code and modules is difficult one. However, in Ruby on rails with introduction of R-spec testing rails code is an easy cake for developers.Ruby on Rails development will be helpful in creating bug-free application. In CakePHP you can do those testing, with certain code changes. Code Structure: ROR has clear code structure compared to that of PHP. Frameworks: PHP has more compatible frameworks like CakePHP, codeigniter and Zend. In Ruby too, apart from rails there are many good frameworks like Sinatra, vintage etc. Both languages has very good MVC architectural framework. Syntax: Both languages’ syntax are clear and simple. However, Ruby without ending syntax was not acceptable many programmers. Memory: PHP along with its fireworks utilizes less memory space, whereas Ruby on rails would use more space. Hence, application based on Ruby on rails would be slower compared to that of PHP. In the war of PHP Vs ROR, developers shouldn’t have any issues in learning both technologies. You could choose technology depending on resource availability and requirements. Ruby on rails is gaining momentum and PHP has proven track record of matured programming language Ruby on Rails vs PHP Comparison A comparison of Ruby on Rails (Open Source) vs PHP (Open Source), Performance, Cost, Scalability, Support, and Complexity by Joseph Montanez First, let’s try to understand why you want to choose a specific technology. All technologies thrive off the community, tooling, libraries and applications. As a business owner, you may want a technology that will last for many years beyond the project's inception. As a developer, you want a technology that will stay around long enough, so you can get a return on investment. Business owners or developers will often base their decisions on their colleagues and community depending on which technologies are highly advocated. In this article we will go over the pros and cons of PHP as well as Ruby on Rails. We will touch on how PHP and Ruby on Rails compares with common topics such as scalability, maintenance, performance, costs, and support. Apples VS Oranges Comparing PHP to Ruby on Rails is not fair. PHP is far more popular than Ruby on Rails, only because Ruby on Rails is a web framework, not a programming language. Ruby is the language behind the Ruby on Rails framework, and PHP is the language used to write applications. Ruby on Rails is comparable to Zend Framework, Codeigniter, Laravel, Symfony2, CakePHP and many other PHP-based web frameworks. So to understand why there is so much popularity with Ruby on Rails, it's better to first visualize people’s searches. This Google Trend graph shows that all PHP web frameworks still do not amount to the number of searches performed for Ruby on Rails (in blue). In fact the only web framework that is growing in the PHP world is Laravel. So then why is Ruby on Rails so popular? Well, a big part of building a web application is deciding what libraries you will use, how to organize your application, and many other factors. To date, many PHP projects still do not use a mature, proven web framework. Many PHP developers would rather create a new PHP framework, rather than use the popular frameworks such as Zend Framework, Symfony2, etc. due to the complexity of an application, as with any frameworks you’ll spend a lot of time learning how to use it. Thus, Ruby on Rails tries to simplify the learning process of its framework by utilizing conventions over configuration — in other words, you (the developer or business owner) have little to decide on when it comes to running, organizing or even hosting the application. This may seem like a good thing, and for the most part, it truly is, which is why Ruby on Rails is so popular. However since then, many PHP web frameworks have recognized this, and are following the developmental steps of Ruby on Rails. This could be why the Ruby on Rails' community growth has stagnated in the past few years. Now while the other web frameworks are shown as a small percentage, you'll still need to keep in mind that PHP is web focused. So just about everything you write in PHP will run on the web, while in Ruby, you will have little choice what code you can write to develop a web application. I. Scalability and Ease of Maintenance Whether it is PHP or Ruby on Rails, both have the ability to scale. However, because of the amount of resources Ruby uses versus PHP, scalability issues will arise much earlier in your application’s life cycle. Scaling an application in Ruby on Rails versus PHP will touch on very common issues. Thus scaling will be based on how the application was designed. There are also services online to help resolve scaling issues such as using Amazon Elastic Beanstalk, or Rackspace Cloud Sites. The situation becomes very different when you go from wanting to scale, to needing to scale. When a developer does not have the experience to scale an application, then the most common route is to find online articles, tutorials and other resources to learn. So when it comes to scaling a website, there are plenty of resources written for PHP developers while Ruby on Rails has a much smaller pool of information. As far as ease of maintenance, this depends on the organization of the application. As long as the developer is using a web framework, then the maintenance overall will become easier. PHP offers a massive selection of web frameworks, all designed for specific goals, while Ruby has a much more limited selection (other than Ruby on Rails). II. Performance and Speed Given that PHP is a language, and Ruby on Rails is a web framework, you’d have to take performance with a grain of salt. The point of using a full web framework is to gain productivity at the expense of speed. So let’s put some perspective on this. Here is a chart of a very simple "hello world" application. Below you can see just how fast pure PHP is when it comes to requests — remember, it’s a language designed for the web. However, once you start to introduce the popular full stack web frameworks, the performance drops, and the requests per second gets closer to the Ruby on Rails number. In fact, a popular web framework Laravel performs worse than Ruby on Rails. As a result most benchmarks are useless, because there’s so much more to the performance and speed of an application than the language or web framework. For example, the database system, caching mechanisms, and network delays can add a 10x to 100x slow down. So how the application is design is far more important than the language or web framework behind it. In general, Ruby and PHP are some of the slowest languages to pick from, but Ruby takes more resources than PHP does. With the given performance issues, both languages have taken steps to help reduce the sluggishness that arise in everyday applications. Both languages have several runtimes, their core runtimes, such as MRI for Ruby, and Zend Engine for PHP. Using those runtimes are rather slow compared to other languages. There have been several attempts to resolve these issues. There has been work to run both languages on the JVM, which is what Java uses as its runtime. The reason to run on top of the JVM, is not only speed, but to also utilize everything Java has to offer. However just because they run on the JVM doesn’t guarantee a faster application. There are things on the JVM that run slower. So if you need your application running as fast as possible then there is also Rubinius for Ruby and HHVM for PHP which are designed to run your applications faster, at the expense of limited platform support. For example Rubinius and HHVM do not support Windows. They do not support everything the core runtimes provide, thus you’ll have to change certain parts of your application to ensure it can run on these high performance runtimes.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages9 Page
-
File Size-