Ask HN: PHP or RoR?
I'm a brand new web programmer trying to create my own social networking site and I've been learning PHP and the Drupal CMS these past few days to build my website.
I ran into a developer the other day and he suggested I work with RoR instead.
As I have minimal starting experience with C++, the OOP side of PHP is what drew me (and the fact Facebook also uses it) in the first place.
Now I understand different project needs translates to different languages, but I was just curious what the HN community thinks about the two?
14 comments
[ 3.7 ms ] story [ 47.0 ms ] threadI personally like Ruby and I like Rails. To me Ruby looks cleaner than PHP and as a result, it gets less messy with lots of code.
Rails is the framework. I love the MVC concept even just for separating my files logically.
Even though it's the ugly child, you won't go wrong with PHP. It scales, look at facebook. It's where the jobs are.
I hope one day ruby overtakes it, but until then I would vote for PHP.
I'm not sure if you made a mistake here, but RoR is a framework. Ruby is a language. RoR shouldn't be compared to PHP. If anything, it should be compared to one of the many PHP frameworks out there.
I agree that there are a great deal of jobs for PHP, but I disagree that "It's where the jobs are." There are a great deal of jobs around for RoR.
RoR has got few resources but they are well done. There are good tutorials and books about RoR. There are good add-ons. And also not a large % of its' developers are just 2 month programmers.
I don't see how the quantity in PHP helps.
This is much less true than you'd think when you're talking about languages of the same class, like Ruby and PHP. (Sorry, Ruby; I didn't mean it that way.) And when your goals are vague ("social networking site.")
The ease of setting up PHP will retard your progress towards understanding the web stack in greater depth, Which is something you'll need to do if you want to become a good web developer. Setting up Python or Ruby with Apache isn't as difficult as you would think it is, given how often the ease of setting up PHP is cited as a reason to use it.
You'll learn better habits and practices from the Ruby or Python communities than the PHP community.
If you're looking for a framework for PHP I'd recommend CakePHP assuming you're not rolling your own for this.
CakePHP was modeled and inspired by Rails.
CakePHP is an MVC framework similar to Rails but they're pretty different now (details wise, structurally still similar). I prefer Rails to CakePHP in most respects but I still code with cake because I like PHP.
One can do a lot of goods with PHP, Ruby and Python and any other languages/frameworks. It's not really the language but what you choose to do with it as well as your experience using it that will make your project. The only way to gain more experience is to start using it.
My feeling is, you want to pick something that will solve all your present problems and future proof. That's going to be difficult. Big solutions are usually a combination of different efforts because there are many different parts of the web development process. I've seen a company that use PHP for ALL their flow including the cron jobs' scripts. Some might say, that's crazy, why not use python or faster languages for backend jobs? But it worked for them up until they hit their bottleneck then they reiterate and revised.
The path toward the "holy grail" for the perfect "solution" is long. Crowd sourcing for this answer will also be difficult because many people have already took that journey and fought their holy war with themselves so they will generally give you their preferences up front.
Sorry for the round about way of saying: I think if you are at a point of asking question of what's out there other than PHP? Then you're at a good transitional stage. Congrats. Now your two (popular) choices are: Ruby/RoR and Python/Django. Go test out two sample projects and make it work from setting up to making it run. See which process you like the most and pick one. I don't think you will go wrong with either choices.
Oh, is there a site that you really like or look up to? Perhaps you can learn about their technology stack and give that a try :P
Again, sorry for the convoluted answer and good luck with your journey toward Web Dev nirvana :)