views:

1658

answers:

17

I'm an intermediate PHP developer looking to take up a new language. I'm completely torn as to where to go at this point. There's so many languages related to web development and programming in general. I had might as well add Ruby to the question.

Java, Python, or stick with PHP and try to really master it? For those of you programming in the language that you love, how did you get there? Did you dabble in many languages as I am doing now and picked the best one? Were you forced to use it because of your employer?

What language would you suggest? I currently get paid for front-end work, but the server-side aspect of web developement has interested me from the start so I'd like to pick a language that is marketable. I know that web development isnt the only thing Java/Python can do, which is a big plus for me if i decide to code something other than a web app.

I hear nightmare stories/trash talking about every language.. Java == "take this language up if you want to work at a cubicle farm." PHP = "inconsistent function naming." Python... havent heard much about the negative side of it except whitespace.

+5  A: 

I've been using PHP primarily for my entire career, but I find it immensely useful to learn other languages and frameworks as well as a source of new ideas and as a way of simply exercising my brain. It's never a bad idea to learn something new.

That being said, because you're asking for career advice, I'd have to point out that at least in my location there has been no shortage of PHP jobs. Improving upon what you already know (just learning more PHP) may be an easier way to increase your value to potential employers. You might look into learning some specific technologies that employers might look for - for example Drupal or Wordpress.

In the end, I'd say it's most important that you're doing something that you enjoy. If you are sick of PHP and it's numerous shortcomings, maybe you'd be happier in a Python or Ruby world. If you're looking to move away from the small-ish web agency world and work on bigger corporate projects, or you simply want something with more structure, think about Java or .NET.

pix0r
+7  A: 

Hahaha ... there always people trashing language they didn't like.

My selection for you is Java. The reason is that PHP is a dynamic language and Python is so too while Java is not. If you want to advance your career or advance your knowledge, you better try different things and to me, PHP and Java differ more than PHP and Python.

With Java, you would learn to be precise and more thoughtful as you need to more design. Java's type checking will force you to think about what type what class, what method, what field to be use and to have. This differs greatly from PHP or Python.

Just my thought.

NawaMan
Python resembles PHP as a cockatoo to a lizard.
voyager
But Java resembles PHP as bacteria and elephant. "..to me, PHP and Java differ more than PHP and Python."
NawaMan
Java is bacteria and PHP an elephant?
just somebody
+1  A: 

You are web-developer? Simple, Python and dJango ftw :)

Rin
Those are nice, but the jobs are scarce.
ryeguy
Yes, but programmers are scarcer.
Lennart Regebro
?really I've heard of programmers who's entire career is focused on django expertise
Fire Crow
A: 

Learn both.

If you want a job(quickly) learn JAVA first and then learn Python.

I love Python and hate Java by the way.

TheMachineCharmer
+5  A: 

We primarily use PHP (front end), Python (back end) where I work. Both are very capable languages. We're also considering mixing some Erlang in there.

That being said, I've seen a lot more jobs for Java and .NET "out there" than for Python.

In smaller more agile companies, you are likely to see PHP/Python/Perl/Ruby being used. In larger and slower moving companies, you are likely to see more java/.net being used.

Where do you want to work?

Keep in mind that above all that is your talent as an ENGINEER, and that will matter more long term than any language you know.


I'd like to add that recently my company did some hard looking into switching operations 100% to Java. Pretty far into the process, we realized that working with PHP and Python (where they are strong) was just way too easy, and we didn't need 84 configuration files in 49 different xml schemas to get 2 things done (ok, slight exaggeration).

Python has been hands down my favorite language ever. I think that the brilliance in the language design is a true rarity, and makes Python quite a joy to work with!


More recently we decided to take the headlong plunge into 100% python 3+, using the excellent mod_wsgi running on Apache. Haven't looked back since.

gahooa
Java != config files, let alone XML.
+2  A: 

Depends on what you're after in your life. Java is better for job security but is likely to land you in the dreary corporate world, Python is more fun but stable jobs can be harder to find.

Of course you always have the option of learning both. :)

Ants Aasma
A: 

If you want money, Java. If you want fun, Python. It's really simple.

J S
As someone who's currently making a pretty decent margin on a job that he got because using Python helped him substantially underbid the competitors who used Java, I would submit that it's not necessarily *that* simple.
Robert Rossney
Yes, disregard the parent comment's advice: There are plenty of java jobs out there but since it's also a very common skill in the marketplace the margins are very small indeed. There's no reason to believe you would be paid more as a Java developer than Python, Ruby or some other more niche language.
Salim Fadhley
+5  A: 

Java. You already have PHP for quick and dirty work. There won't be any system you cannot talk to or any task you need to do that you cannot find a library for with Java. Thats one of the platforms biggest strengths.

David Tinker
That's one of Python great strengths too (it has been called a glue language)
voyager
An addition to voyager's parentheses: I recall a "saying" like "Any program you will write in Python will already have been written before", to point out the libraries' extent. Also see: http://en.wikipedia.org/wiki/Groovy_%28programming_language%29
Dunya Degirmenci
A: 

Learn Grails

It is an agile web application platform, it is like ruby on rails, but instead of ruby as the main language, you use Groovy and Java. Grails is built on some proven and robust java frameworks like spring and hibernate, but hides all the complexity of them.

So, yo have all the java benefits and also the benefits of use a more dynamic language like Groovy.

Cesar Reyes
+6  A: 

There's lots of jobs in Python nowadays. So the Java for Jobs and Python for fun doesn't work any more.

Learn both. Start with Python, it's a little bit easier, and will teach you some good manners you have use of in all languages. :-)

Lennart Regebro
+62  A: 

For those of you programming in the language that you love, how did you get there?

Maybe because my professional "roots" are in HW, for the first 20 years or so of my career (even though it had observably shifted to software development, system administration, technical management -- hadn't actually designed a chip in 10+ years by that time;-) my attitude to programming languages always tended to be "bah, just tools to get jobs done"; I could see the elegance, robustness and depth of certain language-architectures, the clumsiness and fragility of others, but I didn't really particularly care one way or another and focused very much on practical aspects.

Then one day I met Python.

Two years later, I resigned my high-flying development + management job (where I had failed to convince upper mgmt to invest really big in Python -- I had planted Python niches throughout the company, but upper-mgmt didn't want to "risk" anything that wasn't Microsoft-blessed, and, at that time, Python wasn't) to become a freelance -- writing books, teaching, developing, and consulting, mostly about Python (also technical management, architecture, agile development, etc, etc -- but, mostly Python).

A few years later, I connected with a woman through the Python community; soon we married (with "The Zen of Python" among our marriage-readings), we started our honeymoon with a red-eye flight to OSCON (I was presenting, she was co-organizing and chairing sessions), we wrote books together... today, our car's license plate reads "P♥THON".

Soon after, a small up-and-coming company (using Python as one of their core technologies and a great customers for my books &c) made me a sweet job offer -- we decided to risk it, moved to California, and there we still live now (and I still work very happily for that employer, btw). Today, Python is intensely embraced by firms such as Microsoft (via their IronPython open-source product) and Sun (via their support for the open-source project Jython); over the years, I've also been head-hunted by several other companies (again, mostly for Python, though technical managements skills &c also play a part). The language that was somewhat "niche" back when I fell in love with it has slowly but steadily been growing in importance and acceptance.

Did you dabble in many languages as I am doing now and picked the best one?

Definitely -- over the years, from Lisp to Fortran, from Pascal to APL, not to forget Scheme, PL/I, Forth, C, C++, many assembly and microcode languages, Cobol (!), SQL, Perl (I still remember Perl 4 most fondly), many Basic dialects, &c, I have used professionally a huge number of languages (and played with many others). Some I mastered reasonably well, others I only dabbled in, basically depending on what the job-related practical considerations were in each case. In a few cases, such as Modula-2 and Visual Basic, I completed very substantial, totally-personal projects at home, in languages I had no immediate opportunity to use on the job, just to understand a language's strengths and weaknesses better (turned out I liked Modula-2, which languished in terms of market and mind share, and disliked Visual Basic, which on the contrary became very popular -- just goes to show that my tastes and predilections need not match market-acceptance realities!-).

Though obviously I think I picked "the best one" for me -- the only one that truly made me fall in love -- I'd never claim it's the best one for everybody; I have close friends who are world-level gurus in Java, Lisp, Perl, C++, ..., and we deeply respect each others' mastery and choices.

Nowadays I use a reasonably large amount of C++ and C, some substantial amounts of Javascript, SQL, &c, but by far most of my work is in Python.

Were you forced to use it because of your employer?

No, basically on the contrary -- I left my lucrative and satisfying position basically because in it I had too small a compass to use Python, and I decided to risk everything on the prospect that I would find much greater opportunities as a freelance (and, being a lucky fellow, Fortuna helped me and made it happen).

What language would you suggest?

Keep dabbling in your spare time -- until and unless you truly fall in love with a technology, which after all is not all that likely to happen, a mere like, dislike or preference is too weak a basis for betting your livelihood on (but you need to keep dabbling, albeit as a very part-time endeavor, on the off-chance that love will happen;-).

In pure terms of job prospects, Java and C# still appear more solid today than the "up and coming" languages such as Ruby and Python (or Erlang, Haskell, Scala, F#, ...), especially if you're looking for a job in a typical large corporation as opposed to exciting entrepreneurial prospects with startups (which are exciting indeed but higher-risks -- yes, layoffs can happen at any company, but for startups you have to realize that a majority of them end up as failures, alas). Many of the "up and coming" languages and technologies can probably be used at least in "side"/supporting roles even if your main language is Java or C# (thanks to good implementations on JVM and/or .NET platforms), so, even focusing on either of those will not entirely cut you off from the "innovation stream"!-)

Alex Martelli
So, I guess you're saying you like Python?
Robert Rossney
@Robert, sure -- but the key point is, it's only because it was my 20th language or so that I knew the intensity of my "liking" was abnormal and worth risking my excellent job on; and for other people (including my close friends I mention) similar epiphanies happened instead with Java, or C++, or Perl. Can't _know_ until you try... and if and when it really fires up your enthusiasm you can't fail to notice... and most likely _should_ act on it **then**. Meanwhile, Java or C# are likely to allow good, rather steady jobs, esp. at typical large corporations.
Alex Martelli
Hey Alex, That gives a lot of great background on your passion for python and the awesome answers that you have provided many times over. Thank you for sharing.
gahooa
@gahooa, tx for the kudos -- always happy to help or at least entertain;-).
Alex Martelli
Wow, thats a pretty amazing story
Casebash
when you are showing a door to someone you need an explanation when you want him/her decide you need to show them your experience. Perhaps, they influence or might open up to free or take a breath and keep walking on the road to get their own answers. Thanks Alex. It was worth reading.
Ramiz Uddin
+2  A: 

Dabble in all of them. Learn as much as you can, and you won't get shut out at some point later in your career.

If you want to be a system administrator, or do scripting work for the back end of a web application, Python. If you want to be a web developer, Java or C#; the two are mostly interchangeable from a theory level.

Unless you live in San Francisco or another city where it's popular, probably avoid Ruby, as it really doesn't open up many job prospects. Learn it because it's interesting, and because things like convention over configuration will help you be a better programmer.

Dean J
+2  A: 

One neglected thing with regards to many of the answers is that you need a framework, not just a language, for web programming. Smart web shops will use a framework: CakePHP, Django, etc...

You MUST learn a framework, the language is secondary.

With that said, here are my humble predictions/statements:

Ruby On Rails: Web 2.0 only Django/Python: Web 2.0, Publishing, Gov2.0 only Java (with whatever framework): Enterprise only

I know commenters will say, "Company X uses RoR and they're an enterprise". There are always exceptions to the rule. So, figure out what kind of company you want to work for and go from there. I personally switched from PHP to Python/Django and I'm way more productive and the code is far more robust.

P.S. - Obviously you don't 'need' a framework to program a website, but only legacy shops aren't using an open source or commercial framework at this point - it's just not efficient, secure, or good for the long term.

Adam Nelson
A: 

Personally I am a Java programmer but I so loved learning Python - it's so nice writing up example programs in the console and getting the outcome at the snap of a finger rather than goin thru the Java compile/run regimen. Concepts like dynamic/duck typing (which Php probably has), closures, first-class functions, generators etc make it a very wonderful experience and less tedious than Java. There are endless modules available for Python so it's rare that you would have to write something that does not already exist and it would be the opportune time to learn the more recent Python 3 concepts. So even thought I make my living as a Java developer I think you would become more productive quicker learning Python than you would with Java especially coming from a Php background.

non sequitor
+3  A: 

There are definitely more Java jobs out there, and more Java programmers. Java has not changed significantly in the past two years and is deeply embedded in corporations. It will be around for a long time.

There are less Python jobs, but it seems that the market is growing faster. Google is making a big investment in Python (see the Unladen Swallow project) and it is very popular with scientific computing.

I went from C to C++ to Java to Python with a few other languages like Scheme and Eiffel in between. I work as a consultant and now work 90% in Python. I'm just more productive in this language than in Java. In addition, with the latest release that includes multiprocessing I can get better performance than with Java threading (Java threading is much more efficient than Python threading but does not support CPU affinity) and allows me to construct true parallel programs.

If I have a critical loop, I can always write the small routine in C and hook it into Python. In addition, system level functions are fully exposed to Python and makes things like creating daemons possible.

Also, generator expressions and coroutines can make incredibly memory efficient and fast programs. See Martin Wolf's discussion of coroutines and Java: http://bit.ly/3A8pW1

Python is in many ways more like C, it encourages good behavior but does not enforce it: it trusts the programmer--it does not require words like private or protected. It also does not force you to write everything in OOP so if you need to prototype or write a systems function the turnaround is very quick. It also offers a full OOP structure with classes, decorators, etc. Look at YouTube, the number 2 most frequently visited site on the Internet, which is completely written in Python, as is BitTorrent.

If your objective is to easily find a job that will be stable, particularly in a large corporation, then look towards Java as your first language. You should learn it at one point, as well as C++. If you want to sell yourself as someone who provides solutions and become involved with the newer web technologies and cloud computing, you will probably have more flexibility with Python.

A: 

As many others have noted, if you are learning a new language in order to land a job, Java would be your best bet, closely followed by .NET set of languages.

That being said, there's nothing that'd stop you from from picking up Python. I'm currently working on a couple of projects using C#, but I'm also dabbling in Python & Perl.

nsr81
+1  A: 

This is going to be aligned with Alex Martelli's answer: Become a polyglot! Quoting from slashdot.org interview with Rob Pike:

In a typical working day I probably use a half dozen languages - C, C++, Java, Python, Awk, Shell - and many more little languages you don't usually even think of as languages - regular expressions, Makefiles, shell wildcards, arithmetic, logic, statistics, calculus - the list goes on.

Really, monocultures are terribly unhealthy everywhere. Maybe you're not bright enough to get a job at google (most of us, including me, aren't), but knowing many languages will get you a broader perspective and better chance of getting a job however the wind turns.

just somebody