Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is this a good way to learn a new language? Or to develop a preference of one language?

I was thinking of coding a project in both Python and Java. The only foreseeable problem is trying to transfer solutions that should be rethought for each language.

Or is this unnecessary? (My intentions aren't to benchmark.)


migration rejected from May 17 '15 at 2:58

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as primarily opinion-based by Ixrec, Snowman, GlenH7, durron597, MichaelT May 17 '15 at 2:58

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

Just to note have their flagship mapping server in both Java and .net, so it's been done before (but for different reasons I guess) – James Apr 11 '11 at 8:58

I would first complete the project in one language and then do it in the other language.

It gives you a chance to come up to better solutions on specific design problems than just trying to redo the same thing in the second language.

Well, than you could do it once more in the first language and once again in the second. It will be easier and faster every time, that's for sure... – Tim Büthe Apr 11 '11 at 9:05

Sure, if you are wanting to learn, practice can't hurt. But as far as completing a project it is unnecessary. You aren't just changing some syntax, there are different approaches you have to take for each language, so while you might learn a lot, it will be a lot of extra work. If this is for a commercial project it would be better to do it in one language, then in your spare time work on the other.


Another option is to run a Java/Jython environment. That gives you the option of coding anything (code modules, unit test modules or integration tests) in either Java, Jython or a combination of the two.

At any point you can move a module from one language to the other, and re-run the same unit tests as you did on the other - great for having confidence that both do the same thing.

Doing this will add some restrictions on what you can do in both languages, but should be a great way to play with what works best in both languages.


Well it's certainly too much . It shows your enthusiasm to learn different technology and that's good but i want to add this employer picks a person basically on expertise , enthusiasm is a good plus point. As far as free lancing is concerning expertise will get you through most of the things . So in a nutshell i want to say that always focus on being expert rather then knowing it all.

But for the time being in your spare time it doesn't hurt to do that.


Cool idea! Esp if the two languages are very different in terms of programming model. Try the same (simple) app in Java and Erlang, Scala and Perl, or Python and Haskell. I'm not sure it will directly help you get a job but learning new methods of doing things is always a good thing.

Learning new programming methods should be fun!


Yes, it is a wonderful idea if your goal is to learn a new language. It is especially educative if one language uses a different paradigm than the other. Such as Haskell that is functional and Java that is object-oriented. In the old days, people often wrote prototypes in a high-level language such as Pascal for rapid prototyping and then implemented it in assember. But now you don't need to do that because all languages are fast enough.


It's a good idea, but along with learning both, you should compare and contrast as you go along to find out where one language is more suited than the other.


Not the answer you're looking for? Browse other questions tagged or ask your own question.