views:

765

answers:

10

I've spent the last eight months working in the LAMP stack.

Since I just graduated college with a degree in Computer Science, I'm still very new to programming. I've looked at the trends, and for non-Microsoft development stacks, Java and PHP top the list.

Given that most of the Java positions in my area (Toronto, Canada) are for Senior level programmers, should I choose PHP since I see more junior level positions in my area?

+2  A: 

This is the wrong question... you can't compare Java to PHP. Java should probably be your choice, but each lang. used in different scenrios (php is more for web programming, and in java you can do a lot more...)

they are not really comparable.

having experience will protect you in the future in the Java world... it's not a bad thing, it's a good thing.

Dani
"Java should probably be your choice" How so? He already has PHP experience, why would he ditch that when there's a market for him?
Ben S
Why Ditch ? you have php experience.. learn Java. if you get a php job - good, and if not.. you have a lot more opportunities.
Dani
+3  A: 

What do you want to do?

If you have a computer science degree, you should know that a computer language is simply a tool. What job do you want to do? Once you know what job you want, then you go and seek the right tool.

PHP is mostly used in server-side web development.

Whereas, Java is used all over the place, from J2EE systems to mobile devices (Blackberry, Android, J2ME).

Given that you have 8 months LAMP experience, you should know some PHP by now. If you think you'd enjoy continuing that, then don't arbitrarily move to Java.

If you don't like where you're headed with PHP, then perhaps learning Java is a better path.

Ben S
+2  A: 

Java is always worth knowing, along with a couple of the popular frameworks (Spring, Hibernate). There will be junior / entrance-level jobs available. Also it's used a lot in finance, and they pay well once you know your stuff.

JeeBee
+2  A: 

Generally, Java developers are paid better than PHP developers. Also, in the Java world there is a lot more to learn, and a lot more possibilities to explore - mobile development, desktop development, enterprise systems, etc.

Bozho
+13  A: 

Go with the one you personally prefer. You can be successful in both. It's not the language that will dictate your success, it's you.

Stephane Grenier
+5  A: 

Learn both. It doesn't take a lot to learn the basics of PHP, it is a scripting language after all, and you can get started with it really quick. Java is used in a lot of places and is always good to know.

By only learning one or the other you will be severely limiting yourself, not in career opportunities, but also as a programmer. As you learn more languages, the intricacies of the ones you know become clearer and you have more options to use the right language for the right problems.

Oz
+1 This is what I was thinking too. One good way to understand one language better is to learn another language.
Bill Karwin
Please don't think php is a basic language just because many people use it. PHP is a complex language, as complex as many others. Many people make the mistake of thinking php is easy and that's why there are so many php sites with unmaintainable php code :(
AntonioCS
@AntonioCS I didn't say PHP was basic, I said it was a scripting language. And scripting languages are designed to be easy to use, and thus easy start with. I agree PHP has a lot of complexities and I am constantly finding new things in the manual at php.net, but it was a lot easier to pick up than C or even Perl for me.
Oz
+1  A: 

I think the discipline you will learn from java will serve you no matter what you do down the road. From what I have seen in my career, I don't think the inverse is necessarily true.

mtvee
+4  A: 

Your quality as a programmer is more important than the language you find yourself most comfortable in (I'm very comfortable with QuickBasic, but employers are more interested in the fact that I'm creative, curious, motivated, love programming, and know a heck of a lot about computers).

If you find you enjoy PHP programming more than Java programming, that means you will probably be more productive in a PHP-related job.

If you think mastering Java will substantially expand your programming abilities as a whole (rather than just the number of languages you are versed in) then it's probably a good idea.

Java and PHP are different, but not that different. I would suggest you get some experience further away from the familiar. Perhaps do some embedded programming in C, or learn Haskell. Even if you find that they're not your cup of tea, you'll learn a heap of stuff quickly.

Artelius
A: 

Lately I think you should learn multiple languages and not stick to 1 because every language has it's advantages/disadvantages (niche). What language you use does not matter as long as it solves the problem quick(est).

Alfred
+2  A: 

Your career is not in a language.

Investing all your energy in a certain single language is a sure way to doom your career, and more importantly, yourself as a programmer.

Chances are, in 5 years the trends will be completely different. 5 years ago there was no Django or jQuery or AppEngine.

What you need to work on is yourself: just use whatever langauge you like, as long as you keep playing around, have fun, make lots of mistakes, learn from them. Read books, blogs, etc.

hasen j