views:

1791

answers:

15

I've done some dabbling in Rails, but I see a lot more jobs wanting/using PHP than I do Rails. I really know neither of these that well (most of my "professional" experience has been hacking around with Classic ASP and some minor dabbling with ASP.NET; I'm comfortable with OOP and C#/VB.NET), but to maximize my job opportunities I'm highly considering dumping my endeavor to learn Rails to instead learn PHP. However, Rails seems and feels a lot more elegant to me as far as programming with and using, although I'm not a big fan of the "it just works" mentality with a lot of its features.

It seems like PHP would give me more employment opportunities, but I personally feel that Rails "clicks" more with me and would give me a better chance to go independent (which is something that appeals to me). Also there is a lot of poor PHP practices out there due to the language's popularity, while Rails really forces you to adhere to best practices.

What course of action would you suggest? Picking them both up would be a good idea, but I find it insanely difficult to learn two different things at once.

See Also:

http://stackoverflow.com/questions/171964/stick-with-php-or-learn-ruby-on-rails

+6  A: 

Do the one you are most comfortable with, because that will end up making you a better programmer (and more valuable when RoR jobs become available).

If you are strictly looking in terms of job opportunities, then PHP would be the way, but it may not be the one you will enjoy more.

TheTXI
+6  A: 

Learn 'em both. I'm a big proponent of the idea that knowing more languages expands one's thought processes. If all the jobs are in PHP, then it's probably prudent to tackle that one first.

Pesto
Wouldn't it be over-exerting myself to learn both, though, since there are two different mindsets in the PHP and Rails worlds?
Wayne M
Some people are well-suited to learning multiple languages at the same time, others aren't. If you already have a good programming background I don't think it should be too hard to get your head around two at a time, but if you are more on the novice side, it may be more difficult.
TheTXI
There are some different mindsets by default, but there's nothing saying you can't use some of the good mindsets from rails in php. Learning rails has made my php better... specifically keeping my code DRY.
DGM
+1  A: 

You should probably try both and then choose, which one you like more.

Darth
This is a cop out, there are big pros and cons to the issue
TravisO
+4  A: 

"It seems like PHP would give me more employment opportunities, but I personally feel that Rails "clicks" more with me and would give me a better chance to go independent (which is something that appeals to me)"

If you feel that rails "clicks" more with you are would give you a better chance to go independent, why not just go for it? After all you will perform better in things you enjoy anyway. The fact that you say you get pulled towards ruby more then php says enough.

Younes
Yes, but there are a lot more opportunities with PHP to build my "rep" as a developer; remember I'm largely self taught and haven't ever done "real" development, just hacks and maintenance.
Wayne M
You can go independent with Rails, but you have more job opportunities with rails. Well decide for yourself what u want most. If you want to be independent rather then having more job opportunities go for Ruby, otherwise go for PHP.
Younes
+1  A: 

I'm going to say go with PHP. There's a million arguments for and against that I'll let other people get into (these things usually turn nasty), but it's all a question of preference at the end of the day. My preference is for PHP. It can suck sometimes, it can be great sometimes. But it pays the bills.

gargantaun
+1  A: 

PHP is a language. Ruby on Rails is a framework. You can't really compare them. In order to make PHP compete with ROR, you need to use a framework (and you probably should if you use PHP). I recommend CodeIgniter. It's easy to learn and is very lightweight and efficient.

ryeguy
I would certainly be using a PHP framework if I went that route, just obviously I'm not sure which one at this juncture :)
Wayne M
+1  A: 

Another factor is whether you're looking for employment opportunities in existing projects/teams, in which case PHP is probably the better option just because there will be more openings. If you're looking for jobs where you'll be able to choose the technology from the start, then go with your heart.

Randy Orrison
+1  A: 

PHP is older and has got a larger user base. You will probably easily find someone who knows PHP. That's quite useful when you start. PHP is much more used which means you're going to run into legacy code in PHP quite often. You also have so many projects written in PHP out there that it can help you a lot.

Ruby is a cleaner language and is its ascending phase. ROR is an incredible platform. Ruby is more rigorous. Ruby is first of all a great scripting language you can use to do non web related tasks. It will give you good habits.

If I had to start a project from scratch and I had to choose between PHP and Ruby I would go for Ruby without a second thought even tough Ruby is not here performance-wise.

What I would do is invest a lot into Ruby and enough into PHP to understand why Ruby is technically better.

Just keep in mind that what's more important is to have a rigorous creation process than to know x or y language.

Edouard A.
+1  A: 

I second the "learn both"-answers: In any case, knowing both will probably give you an edge since they both work quite differently.

For example, Ruby might inspire you to do things just a bit differently but better in PHP in a way that you would not have thought of if you'd only know PHP.

Lennaert
+2  A: 

I'd try to learn Rails inside and out first. Get really comfortable and proficient with it, and at the same time learn the design principles behind it. I think you will enjoy yourself more, and learn a lot in the process. Plus, you'll find excuses to use Ruby in other areas as well.

Then, if you want to learn PHP because you think you will be more marketable, do it, and you'll be more pragmatic with it and produce cleaner results.

Aaron Hinni
+3  A: 

A friend of mine says he "goes where the food is" so pick the one that will earn you a decent living (then you can study the other one as you wish).

This assumes you really need to make enough money to actually live on and aren't just looking for some extra work.

gaoshan88
Yeah, my current job is as a one man IT department doing everything from helpdesk to DBA to programming so I'm looking to escape it ASAP.
Wayne M
Then you want PHP, there are lots of PHP jobs out there looking for coders, but Ruby is a nich language with too many people drooling over the idea of it, that's a long shot and low pay.
TravisO
I'd say PHP is the better of the two assuming what I posited was accurate. My friend is a .NET developer while I stick to PHP, FWIW (and he constantly picks at me for using PHP... so sick of that sort of thing).
gaoshan88
+2  A: 

One thing you could consider is going the PHP route since the jobs are out there now. PHP is object oriented and since you are familiar with that then why not go with it. If you already know the concepts then PHP should not be that much of a stretch.

Yes, there are a lot of poor PHP practices in the industry, but that is also true for just about any language. Poor practices are a result of poor standards and poor processes for following those standards. If you use PHP then you can create your own best practices and use them.

Doing PHP would allow you to go independent now since there are a lot of jobs requiring that skill. You could learn RoR later when it's more prevalent in the industry.

It's like I always tell people, once you learn one programming language (for the most part) the only thing that really changes when you try to learn a new language is where to put the fracking semicolon.

Ultimately, I think you should go with what you think is the best option for you. Who knows you may be the one that starts people on a rush to use RoR.....

Mark
That's an idea. There are jobs using PHP and none using Rails though, and I'm looking to escape the dreary "one man shop" job I have now so I'd rather get things started sooner rather than later...
Wayne M
A: 

There is Alot more work for PHP but saying that you will also that theres alot more people offering there services in PHP. This tends to even out the playing field.

Stick with the one you feel more confident in learning, and go from there, it is good to have a good understanding of both Ruby and PHP.

Keep motivated and keep learning, Goodluck Learning PHP

Kye
+1  A: 

If you are going to build a web application with PHP, I HIGHLY recommend checking out the PHP Fat Free Framework. I've used Cake, CodeIgniter, and the Zend Framework and the PHP Fat Free Framework is simply fantastic. It's very small, extremely flexible and incorporates cutting edge technologies such as MongoDB via add-on modules. The framework itself is mind-blowingly small. It's by FAR my favorite PHP framework. It also strongly encourages you to keep good programming style (MVC). So, if you are serious about PHP, you really should become familiar with the PHP Fat Free Framework.

Lee
A: 

What about the new web 3.0 stuff? Got a look at the Real Studio beta recently. Blew me away. It changes everything.

Craig Booth