Yongfook’s posterous - free toy inside
« Back to blog

PHP vs. Rails

Sometimes I get asked by friends or colleagues,

"Should I build my app in PHP?  What's this Rails thing?".

A programming language is a means to an end, I tell them.  It is a tool.  

A talented PHP developer can write cleaner, faster software than a lesser Rails developer - and vice versa.

If you have access to awesome Rails talent, build it in Rails.  If you have access to awesome PHP talent, build it in PHP.  If you know a guy who can build you a world-class web-based SaaS app using Fortran punch cards, build it in Fortran.

Apps, websites, web applications - whatever you want to call them - are built by people, not programming languages.

Comments (17)

Oct 26, 2009
Great explanation! Thanks.
Oct 26, 2009
Thomas Gay said...
fortran? seriously? so a guy hands you a pile of punch cards... what do you do with them then?

you're right, languages are only tools. but you can't build a house with a spudger, if you catch my drift.

Oct 27, 2009
gary said...
We spent 3 months building our site in fortran punchcards, it was the best decision we ever made.
Oct 27, 2009
yongfook said...
I could have done it in 2 months using BBC Basic.
Oct 27, 2009
roman valderrama said...
Once the basics are down, most OO languages/script engines are very similar. After that it's all about which one has the better set of libraries or environments to work with.
Oct 27, 2009
Nathan said...
I will also add from my limited programming experience that some languages can be more elegant or have inbuilt functions that others dont have that just makes things more convenient. And as someone else said, support, libraries etc are paramount.

Yes to a large degree it depends on the programmer, but by the same token you cant hand someone a spoon and some glue and say "hey, go build a house".

Oct 27, 2009
Shoan Motwani said...
Also the end consumer usually doesn't care what the site the built on. The primary focus should be to deliver on promises.
Oct 27, 2009
JM said...
As Nathan said, some are easier to work with, the documentation, the libraries, etc. I've been trying to teach myself PHP and find it much more, I don't know, 'legible' and intuitive to work with than when learning Javascript. The best technique I've found is to skip the books and go and do it yourself with whatever is out there (been playing with CMS's and Wordpress mostly) as well as reading the excellent PHP manual. Find or create a problem and solve it. (Same goes for learning human languages)

And, as Shoan said, if you're doing it for money, it's whatever gets the job done and works for client that is best. The simpler the better. I've worked at a big corporation that bought a lot of fancy backend stuff but couldn't put the time or effort into creating a usable interface for the customers to work with.

Oct 27, 2009
JavaScript and PHP are rather different. Most websites need to use Javascrpit for front end development. Regardless of the server side software.  

Sent from my iPhone

Oct 27, 2009
JM said...
Oh, I know what the languages are meant for. I was trying to speak more to learning a language and understanding how they work (which is the important part of choosing which tool to use in a situation) as well as what Nathan said about libraries and support. Sorry if it sounded a bit ambiguous and off-topic.
Oct 27, 2009
Oh. Good point. PHP was very easy for me to learn. :)

Sent from my iPhone

Oct 27, 2009
noam said...
Great post! After all, it comes down to the human element.
Oct 27, 2009
Chris Nohara said...
I think this type of thinking only applies to the web world perhaps? In the embedded world, theres a big difference between coding something in C, Java, or assembly in terms of code size and speed.
Oct 27, 2009
Yes. Very true. As, all web languages end up doing the same thing, generating HTML, it doesn't really matter which language you use.

But, your right. On the desktop, it definitely matters. :)

Nov 04, 2009
Bijan Rahnema said...
you are absolutely right... the problem I have with rails is its complexity.. there are so many things in the framework that it is nearly impossible to understand every corner of it... I like codeigniter a lot because it is much easier to understand although it could be considered to be not as mighty as rails out of the box.
Nov 04, 2009
I love CodeIgniter. It's so easy and logical. Rails isn't so easy to learn.
Jan 02, 2010
Mac Tyler said...
@Spencer Schoeben Actually that isn't how it works at all. They maybe all end up doing the same thing, writing to databases and spitting out content and saving things. But they don't all merely "generate html". The html is completely separate from the actual languages running the website, the html doesn't really change at all between those. The HTML is separate from the debate we are having.

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    twitter