PHP was
built primarily as a server-side scripting language for web development
and dynamic content and, it has been around since 1994. PHP code was
originally embedded within the HTML code so that the content could
change according to the needs of the coder. This too changed with the
arrival of frameworks into the development world.
Ruby was first launched as a scripting
language that was more powerful than Perl and more object-oriented than
Python. Ruby was born in 1993, and its first public release came up in
1995. Although Ruby was older than PHP, only after having ties to Rails
in 2005, did it really start gaining popularity.
PHP is a stand-alone language, whereas,
Ruby on Rails is a language combined with a framework, therefore we can
only analyze some of the general differences which are
Scaling
They are both equally easy or difficult
to scale in different levels. The first level of scaling is just about
adding more memory/cpu/server instances. Once this is done, they are
both equally hard demanding all of the same methods as scaling any other
web application on the internet.
Web hostin
PHP applications do
have support from most of the web hosting companies, whereas Ruby on
Rails is supported only by unix based server. On hosting front, PHP is
an obvious winner. But with introduction of Heroku, ROR applications can
be hosted easier.
Application performance:
- Add New
There is no hiding the fact that PHP codes run faster than that of Ruby on Rails code.
On the other hand, we can achieve tasks in RoR with few lines of code
when put next to that of PHP coding. So, achieving tasks faster with few
lines of code is the clear winner for me.
Frameworks:
On the framework front, there is no
clear winner as both PHP and Ruby have good MVC architectural framework.
PHP has more compatible frameworks like CakePHP, codeigniter and Zend.
But, in Ruby too, apart from rails there are many good frameworks like
Sinatra, vintage etc. So it is a tie when the comparison is about
frameworks.
Testing:
Testing code and modules is a difficult
affair in PHP. 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
too you can do those testing, but, with certain code changes.
Code Structure:
RoR has a clear code structure when compared to that of PHP.
Memory:
PHP utilizes less memory space because
by default they don’t have the overhead of a web framework. whereas Ruby
on Rails would use more space. Hence, application based on Ruby on
rails would be slower compared to that of PHP.
Syntax:
Both have syntax that is clear and
simple. However, Ruby without ending syntax was not acceptable to many
programmers. So the final conclusion is, if a client project already has
existing PHP code and we’re developing for that, that is, integrating
at the software level, we stay with PHP. Whereas, if a client needs a
brand new application then we have a slight inclination towards using
RoR. I am not saying that PHP is bad. Come on, you have already gone
through the comparative study! Last but not the least, when CodeWebber
builds a new app for our own needs, we use either PHP or Ruby on Rails.
Happy PHPians?
At CodeWebber, we value your business. Our team of experts are waiting for your query. CONTACT US!
Source: CodeWebber
No comments:
Post a Comment