views:

3253

answers:

21

Hi, I am a CS student and I wanted to get some more experienced folks' opinion on the following: I have a strong background in the curly bracket languages, particularly C and Java, and have been working with php for about a year now and again. I am also currently interning at a PHP shop.

My goal is to hopefully get a job in web development, maybe contracting for small companies or something while I finish up school.

So what is best? To stick with PHP and become an expert, as I already have a strong basis, or to go ahead and put some serious time into learning ruby on rails over the next few months?

Here are the reasons I am considering learning Ruby:

  1. Since I am so used to languages with C-like syntax learning a language with a different way of doing things might be helpful.
  2. Rails makes web development so easy compared to all the things you have to build up using PHP, e.g. I often try to implement a MVC approach myself on PHP projects, a lot of work for what rails gives you out of the box.
  3. I tried working with CakePHP and symfony but I could tell pretty quickly that they were knock-offs of rails, the PHP syntax just doesn't work quite as you would hope.
+53  A: 

Definitely go with learning Ruby. You don't have to abandon PHP to do so. All of your points are valid:

  1. You already have a strong background in PHP, and learning a second language can actually give you a fresh perspective and make you a better PHP programmer as well.
  2. Learning another approach like MVC, whether it's with RoR or not, is always a useful addition to your mental tool kit.
  3. See 2.
Adam Bellaire
learn how to build RESTful apps too
MatthewFord
+9  A: 

I would look at RoR, or even Python via Django or TurboGears. You already have experience with PHP and you realize that there are some limitations/faults with it, so why not learn something new?

Not to knock PHP but I haven't written a web site with PHP since version 4. A lot of the benefits of RoR or Django is that much of the work you had to do manually in PHP is part of the framework. There is less "roll your own" with these frameworks. Even though PHP has a lot of code snippets you can add to your site, there is still the hassle of verify they work the way you want.

Plus, the speed of web site development is (claimed) much faster than with PHP. Of course, you'll find people who claim the opposite so that is probably something you'll just have to test yourself.

At a minimum, you can't go wrong adding another language to your resume. An added benefit is that Ruby and Python can be used in areas outside of web development, whereas I haven't heard of a standalone PHP application (though someone is probably working on one).

crystalattice
I have a few that I built. (standalone PHP apps.)
Unkwntech
I also built a few standalone apps.
Milan Babuškov
Well, as I said, I'm sure there are some. I just haven't seen any in the wild. PHP is normally associated w/ web sites.
crystalattice
Of course. Even though I did it, I still prefer C++ for non-web stuff.
Milan Babuškov
+13  A: 

Don't see it as a conflict, learn both. None of them is complex enough that you couldn't become an expert in both.

Theo
+8  A: 

I would say, look into rails, but stick with php.

Rails has a lot of smart ideas in it - MVC and what not - but there is nothing stopping you from writing smart php code. There will always be jobs for php developers, and every hosting company under the sun will support it. If your looking do freelance stuff stick with php, its the ultimate in indie web development.

But like I said before, take a look at how rails does things, because a lot of the idas are really smart, specifically the ORM.

One plus side to learning rails though, is that in the process you learn ruby, which is a much more general programming language than php. This would allows you to write all sorts of usefull scripts on the server and desktop. Php can be used on the command line, but its not nearly as pretty.

Will Harding
I would strongly suggest learning Ruby first, and learning how to use some basic Ruby CGI tools, before using Rails.
Max
A: 

Rails makes me happy. I can walk onto a project and understand it almost instantly.

PHP on the other hand scares me because I never know what I am going to get.

More practically, there are lots of PHP jobs out there and very few rails jobs. Conversely, there are also very few rails coders so demand & salary is high.

srboisvert
The problem with PHP is more the ease with which it attracts poor programmers, not the language. I have my own MVC framework that I made in 2 days, the core of which is only 65 lines. I'm quite sure it wouldn't scare you.
The Wicked Flea
I agree the "problems" that people point out with PHP are due to poor developers not a poor language.
Unkwntech
A: 

Become a master of whatever seems more comfortable for you, but know both if you like both.

Vasil
A: 

Learn a new language (Ruby, Python, whatever) while you're still a student. With a base knowledge of PHP, you should be able to get a job that will pay you to become an expert. But you'll have a harder time finding a job that will pay you to learn a new language. It's much easier to do while you're still a student.

Scott Reynen
+2  A: 

I've been in exactly the same situation about a year ago (university, knowledge of bracket based languages and so on). I decided to give Rails a serious try and it worked out just fine. Today I am working on various freelance projects with Rails. It's a lot of fun and I'm earning quite a lot of money (compared to my colleges at university).

The barrier of entry into Ruby on Rails isn't as high as you might think. Definitely go with Rails!

Christoph Schiessl
+2  A: 

Yes. While you are a student you have free time. Use it to broaden your experience as much as you can.

Kevin Conner
+4  A: 

I don't know if Ruby is that much different from Java or PHP. Why not try something completely different like Haskell?

Not that there should be much job oppertunities for Haskell web development. But on the "different" scale it should score high points.

So thats Imperative, Procedual, OOP and FP. I'm not aware of any web frameworks for Prolog, but that certainly would classify as different too :)

John Nilsson
+11  A: 

I would suggest learning Ruby first and then look at the rails framework separately.

As others have stated: One becomes a better programmer by increasing what is known about programming. Learning a new language is the best way to do that, but it is easy to become discouraged while trying to figure out why a framework does what it does without first knowing the language.

All that being said. I have the utmost respect for Rails and I absolutely love Ruby (especially for text processing); but at the end of the day I will most always use PHP for both quality and ease-of use.

on a side note: Code Igniter tends to be my framework of choice these days; it tends to get out of the way and let me get stuff done.

Causas
+1 for Code Igniter
SeanJA
+10  A: 

Being an expert in PHP is very useful. ONLY being effective in PHP is a handicap. I've realized my own deficiencies, and I'm in the process of learning Python. I chose it because my time is limited and I wanted to learn something with broad application: Django, Google apps, rich client apps, and cross-platform system scripting. Ruby is similar in this regard.

You really can't go wrong with learning Ruby or Python, even if you stick with PHP as a focus, because you WILL be able to use it.

Jerph
+1  A: 

As many others have said the conflict only exists because of the religious nature of programming languages. If you are serious about your work you should make it your mission to become competent in as many languages as possible for several reasons:

  • You'll find a lot more jobs out there if you can expand your abilities
  • Once you've mastered a couple of languages you'll find that you'll find better ways to apply yourself in your other languages.
  • By learning multiple ways of doing things you'll ultimately learn the theory behind the work you're performing.

If I were you I'd learn to program in everything you can get your head around. I would go as far as to recommend joining an online community dedicated to general Web Development, such as the SitePoint Forums or a few IRC channels dedicated to these languages.

EnderMB
+4  A: 

There's no right answer here but I'd like to chime in with a point I didn't see mentioned yet:

Get good at web development... period. No matter the language make sure you understand and have put into practice various principles like MVC, active record, ORM stuff, DB partitioning, HTTP & apache performance tricks (YSLOW type of info), JS patterns, etc.

You'll find that a lot of potential employers will not automatically disqualify you just b/c you're not a pro in the language their site is built in. Many employers want to see that your thinking & approach is sound... do you understand how to build a scalable site vs. do you know language x.

FWIW: my only experience with ruby on rails has been a "hello world" type app I did for curiosity... I'm a PHP guy & have been since before v 4.0. however im my recent job hunt I was offered jobs in both ROR and Python shops even tho I'm not too proficient in those languages.

One caveat is the fact that you're a student. Recent grads may not get the same benefit of the doubt but to an extent i believe it will apply to your demographic as well.

I have hired non-php recent grads for PHP jobs. There's been grads with great OO experience in Java w/ MVC experience etc who I hired b/c their foundations were sound and I was confident they could translate their Java/Struts experience to OO-PHP + MVC apps

arin sarkissian
A: 

Stick with both php and RoR. While your at it learn some Java and c++. The more you know the better a programmer you will be.

Kevin Kaske
A: 

Neither, write an iphone app and profit.

On a more serious note. I learnt Ruby before I left Uni, at the time the better web dev jobs in Ruby out numbered PHP (which I also knew) and I preferred working in Ruby.

Get a good book which covers Rails 2.1 and see if you like it. Otherwise you can always go back to PHP.

MatthewFord
+1  A: 

It never hurts to learn additional languages. Chances are, learning Ruby will make you a better PHP programmer as well.

Bruce Alderman
+3  A: 

One consideration to think about is what type of work you like to do... do you like to quickly build and move on, or do you want to stay with an long term project. I ask because I am involved with a long term project - it started before Rails hit the scene, and I hope will continue for some time.

I tried to refit the whole PHP codebase into rails, but had some difficulty making it fit. I gave up for a while, needing to focus on more pressing issues.

I discovered a problem though, in a rails app I built for someone a year or two ago, who recently asked me to do some maintenance on it. Rails has undergone many changes in the meantime, and it was a painful experience to upgrade and learn all that had changed.

Rails is a moving target still, and so to use it you have to be willing to constantly adapt to the new methodologies, some of which are not well documented, at least not in a timely manner.

Those difficulties forced me to give up on rails for a while, it was distracting me from getting real work done. PHP, despite all of its warts, is at least a fairly stable platform that doesn't break underneath me often.

That said, I love Ruby and Rails for their succinctness, elegance, and beauty - it seems to me to portray "the right way to do it" most of the time, but it's still too much of a moving target when someone finds "a better way". If you love beautiful code and don't mind the moving target, by all means, learn RoR! If you don't like the rug being pulled out from under you, stick with PHP as your main focus.

DGM
+1  A: 

Since you've already tried CakePHP and symfony, you could try Akelos. It is intended to be a PHP port of Ruby on Rails. The developers also created what they call Sintags that allow your view code to get as close to Ruby on Rails syntax as PHP will allow (as far as I can tell). There are some samples at that link.

I'd give it a try. It's probably not as far along as it should be, but it has been used in a production setting.

Robert Rouse
A: 

You could also have a look at maintainable. (I use symfony and like it a lot, but I am interested in taking a closer look at maintainable.)

Erik Itland
Maintainable looks promising. However there is no community or support and the documentation is slim (although what is there is detailed).
robsymonds
A: 

3 years in php, but i wish i learned RubyOnRails instead.

land rover