Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.)

share|improve this question
    
Just to note esri.com 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
add comment

migrated from stackoverflow.com Apr 11 '11 at 7:00

This question came from our site for professional and enthusiast programmers.

8 Answers

up vote 33 down vote accepted

It may be valuable from a learning perspective, but you'd need to be careful to make sure you don't try to write Python code in a Java style, and vice versa. Different languages have different approaches to solving problems.

share|improve this answer
    
I find this happens a lot when trying to write the same thing in two different languages. If the second language supports the coding style of the first one, you will end up using the exact same style (which isn't really learning the language). –  jsternberg Apr 11 '11 at 14:47
add comment

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.

share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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!

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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