views:

412

answers:

12

I'm a relatively new hire, and I'm starting on a small, fairly simple project. The language that this project will be implemented in is still to be determined. The question basically boils down to - Java or Python?

Here's the dilemma: My manager would prefer it to be done in Python. I don't object to that, but I have no experience in Python. I'd really love to learn Python and think I could manage it fairly quickly (especially as it's a small project). BUT the project is due at the end of March and must be ready by then. So they'd rather have it in Java and on time than in Python and late, and they don't want to pressure me to do it in Python if I think I can't make it on time.

Sorry about the background - but my question basically is, how long does it take, on average, to adapt to a new language? I know this is subjective and personalized, and depends on how fast the particular programmer is... but talking about an average programmer, or even a somewhat fast one that picks up things quickly, what percentage of an increase does programming in a non-native language (but with similar concepts) cause? As in, if this project would take me about 2 weeks in Java or a .NET language, how much longer can it take me in Python? Can I assume that having double the amount of time (i.e. a new, unfamiliar language causes a 50% increase in programming time) is adequate?

And included in this question - from what I've heard, it seems to be pretty easy/intuitive to switch over from Java to Python. Is this true...?

Thanks everyone for all the answers! I didn't realize there are so many sides to this question... I will try to choose an answer soon - each response made me look at it a different way and it's hard to choose one answer.

+5  A: 

My boss's rule of thumb is any time there's a learning curve, it can triple the time to write the application. So, if Java would take you two weeks, then Python may take about 6.

David Hodgson
However, you'll never learn anything new if you don't start now. It will take longer. It will be hard. Your boss wants you to learn Python. Learn Python.
S.Lott
His requirement is to have it done by the end of March, Python is just a preference not a requirement.
Robin
@Robin: Actually, the project is only "due". That could be a preference, also. It's unlikely to be a "hard deadline" as in "we'll all get fired if you don't get this done." It's only "due".
S.Lott
+3  A: 

Python is like baby java, you'll pick it up in a breeze.

Malfist
I agree that Python would be easier to learn but would say that it is like grown up Java! :-)
GreenMatt
If you write Java programs in Python syntax, you'll do fine. Python does everything Java does, and more. You can even continue to use ';' if it makes you happy.
S.Lott
@S.Lott: but you'll still need to indent *correctly* your code... :)
Bruno Brant
@Bruno Brant: Most people indent other languages very close to Python standards. Indeed, Eclipse will correct indentation of Java to look very much like Python. So changing to Python indentation is easy.
S.Lott
+4  A: 

It always take longer than you think.

Try writing a small program doing just a bit of what you need. If you are to write a program with a GUI then make small program showing a frame with Hello World and an Ok-button and see how hard that is.

Thorbjørn Ravn Andersen
A: 

Are you just programming or are you designing/architecting?

If you are coding according to a design that an experienced Python resource has layed-out then I'd give myself 3-4 times as long since you've described this as a small, fairly simple project.

If you are designing/architecting this yourself then you're taking on a big risk by trying to learn a new language at the same time. There's too much chance that you could design something at the onset that is core to your design, only to figure-out later that it doesn't work and you need to rewrite alot of stuff because of it.

That being said I would present the risks and such to your manager (showing your obvious enthusiasm for learning Python) and let him make the call.

SOA Nerd
The problem is he's leaving it up to me. He knows all the risks and everything and wants me to make my own decision.
charlie
@charlie - Hmmmm.....In that case I'd personally go for Python. I like to learn new things and nothing drills those home like having a project. Make sure that you setup a good timeline to begin with though so you can keep track of your progress and make sure that you're still ontrack. Good Luck :-)
SOA Nerd
+2  A: 

Well I would say how fast you pick up Python also depends on what other languages you know(or comfortable) apart from Java. If the only language you know is Java then I don't think the switch from Java to Python would be intuitive or smooth. To start with Java is statically typed and Python is dynamically typed, and it takes some time to get used to OO programming with Python even if you are skilled in using OO techniques using Java. So I would say honor the timeline and finish the project in time (or earlier :) using Java since this is what your work demands.

Keep learning Python and automate some of the routine activities you do using Python so that you get a reasonable level of confidence to work on new project using Python.

sateesh
+8  A: 

I think it depends on the area of the project. While GUI is not hard in Python, any kind of GUI-framework will have a somewhat steep learning curve. If it is a webapp, I'd say go for Python. The added time for learning is quickly gained back by easy of use of the many Python webframeworks.

The big risk is that you will code Python just like you code Java. Many of the things true in Java are not true in Python and vice versa. It will probably make your Python code slow and verbose.

If you decide to try Python, read up on common pitfalls coming from Java, for example: http://dirtsimple.org/2004/12/python-is-not-java.html

truppo
Verbose yes, slow will be barely noticeable.
S.Lott
Paradigms. I once did exactly this, coded python as I code C# or C++. And now I'm coding COBOL... some of the other programmers wan't to kill me when I do certain things...
Bruno Brant
+7  A: 

You have roughly 5 weeks to complete the project. If you're confident the Java version would take 2 weeks, that leaves 3 weeks to flail around with the Python version until you have to give up. I say go for it. Python is relatively easy to pick up. I think three weeks of work is enough to time to know whether you can finish by the deadline.

IMHO, this is a great excuse for you to learn a new language. Keep updating your manager regularly with your progress. I think the right decision will become apparent as time goes on.

Kristo
Whoa, whoa, whoa. While I agree with your opinion 100%, let's not put words in his manager's mouth that this is a "great opportunity" for anything. He said, "My manager would prefer it to be done in Python." which in most offices, the meaning would be along the lines of: "More people have core Python knowledge here (easier to maintain)," "Python less verbose, so it's easier for someone else to add/fix/modify/maintain." Done, and Gets Things Smart :)
Marc Bollinger
It's more of an "I'd like you to learn Python eventually and this is a good project to start on." Most of their stuff is done in Java, but a lot of side stuff / throwaway code, etc. is done in Python.
charlie
@Marc Bollinger, you're right he doesn't say that anywhere. I must have inferred it from comments and whatnot. I've edited my answer accordingly. The most important part is the OP shouldn't go sit in a hole for three weeks learning a new language without updating anyone on his progress.
Kristo
+2  A: 

If you Google for "Pythonic", you'll find a lot of discussion about how to do things in ways that fit well in Python, will be easy to understand by other Python users, and so on. It always takes a while to progress from code that simply works in a language to using that language well -- and in the case of Python, that learning curve is a bit longer than normal.

In the end, I'd say the answer depends on your age and personality (and your perception of the "personality" of your employer). Relatively speaking, Java is the conservative approach -- it reduces risks and probably gives the best chance of finishing the job on time and within budget. Using a language you don't know increases the risk of not delivering what's needed. Chances are that you'll end up writing it (at least) twice, once in a form that's pretty similar to what you would have done in Java, and then again in a form that's more Pythonic. That may well mean some late nights, especially if you get down to a week to go (or something on that order) and realize you need (or badly want) to rewrite almost everything you've done so far.

It mostly comes down to a question of whether you're comfortable with assuming that risk.

Jerry Coffin
+1  A: 

I'd say if you want to avoid possible headaches, do it in Java and learn Python at home, by trying to re-create a similar application to the one you do at work, if you want something which feels real. It's likely that if you arent familiar with Python you arent going to take advantage of its capabilities anyway. Once I took a look at the first Python application I made, and it looked like I wrote an Object Pascal application in Python syntax

Pablo
+1  A: 

Generally, if I'm not familiar with a language, I allow at least a month to get somewhat comfortable with it. Two or three months if it's outside my "comfort zone" of C-like languages. Having said that, I think Java and Python are similar enough that you might trim that a bit.

Also, based on your own history, how good are your estimates when you're familiar with a language? If you think it will take two weeks to do it in Java, how well can you rely on that estimate? Personally, I'm sometimes way under, even when I think I'm being pessimistic, but maybe you're better at estimating than me.

A part of me is tempted to say "Go for Python". That's at least partly because I'm a Python fan. However, as a new hire, you probably ought to make a good impression, and I think you'll do that better by delivering on time (or early) than by learning Python.

However, if there are parts that can be cleanly separated out and done in Python, maybe you could do some parts in Java and other parts in Python.

GreenMatt
A: 

Charlie, being a new hire and all, you shouldn't really decide on which technology to code the project. This is a management decision.

In fact, even though team skill can be used to determine the technology of choice for one or other project, there are many other, more important, things to take into account.

Which technology serves your purposes well? Assuming it can really be done in python and java:

  • Is time-to-market really important?
  • If you need to expand your team (i.e., extend the project), will you be able to hire more Python programmers? Are they more or less expensive than Java programmers?
  • Are there other projects in Python at your enterprise (or your clients enterprise)? A homogeneous environment is easier to administrate.
  • Learn the differences between Java and Python and see which one applies better to the problem. For example, Python probably performs worse than Java... But Python programs can be programmed and tested way more quickly.

And, of course, yes you can take into account that there's a learning curve. As another answer put it, Python is very simple, and so is Java and almost every common language out there. What kills you is learning API's, SDK's, debugging tools, environment differences, etc.

Another thing, that I draw from experience: never believe that a project is done when its done. Everything changes, so when you deliver the product, either your manager or your client (whoever will use it) will ask you to change something, and once you're done with that change, there will be more. Software are living things... they only stop changing when they are dead.

Bruno Brant
A: 

My personal preference is to learn new languages on personal projects, and use tools I already understand on professional projects. So if it was me, I'd do the project in Java, and do a few little Python projects at home.

But of course, you learn a lot more a lot faster when you are using a new language "for real" forty hours a week, so if you have adequate support from management and co-workers, then take advantage of the opportunity.

Kristopher Johnson