Is a switch from Java to Python worth it?



I am a university student taking an Artificial Intelligence class this semester. Our professor's programming language of choice is Java, but it seems that perhaps with some nudging, he can change it to Python.

I wanted to know if there is any merit in doing so. I know a programming language is just a programming language - however, given the industry's wide use of Python when implementing AI algorithms (especially with ML), I think it makes much more sense for us to use Python. It will be easier to transition from a University environment to an Industrial one having done several assignments in Python and having a clear understanding of all the tools it provides than if we continue using Java, correct?

What are the advantages and disadvantages of a switch from Java to Python?

John Lexus

Posted 2018-05-09T13:58:33.037

Reputation: 141

Question was closed 2020-03-04T01:47:49.133



While dyedgreen is right in some respects, I don't agree entirely with that sentiment. Sure, you can theoretically use any language as long as you know the maths and understand the concepts inside and out whilst having some applicable knowledge.

However, I don't believe if you are starting from scratch, you should learn to develop models in Java. While the underlying material is the same, all you are doing is wasting time IMO learning a language that is rarely used in the field and lacks sufficient support by most modern ML frameworks. Also, while this is rather subjective, python feels better when used as a data science language. Working with data especially is where that difference is clear to me.

That being said, this could all change, and Java could become the ML language of choice(extremely unlikely).


Posted 2018-05-09T13:58:33.037

Reputation: 1 151


I don't think there is much merit in using one language over the other.

It's true that you will get a better feeling for what libraries etc. are available in Python when using it, but I think it's more important to focus on the mathematics and application of the algorithms and techniques you will learn, as these will be relevant regardless of the language / library you end up using.


Posted 2018-05-09T13:58:33.037

Reputation: 57


I'm going to go ahead and disagree with the others. From an academic perspective for AI or any CS related assignment Java (or C or C++) will always have much more benefit as you will get to write the actual code instead of using libraries others have already written. That way later on when you transition to Python or whatever language you choose you'll know whats under the hood and use it and optimise it more effectively than someone who only knows which libraries to use for what application.


Posted 2018-05-09T13:58:33.037

Reputation: 362

Your premise of learning by implementing isn’t wrong, but there’s no correlation between this and the Java vs Python debate. Java has ample libraries and it’s entirely possible (arguably easier) to implement such by hand in Python. – G__ – 2018-05-10T02:38:49.637

My point was to avoid the libraries whilst learning. – solarflare – 2018-05-10T03:24:01.393

Sure, I get it - but I read the answer as recommending Java over Python specifically because it would force/allow writing of code versus library glue, and I contend that you can take the coding OR library glue approach in either ecosystem. – G__ – 2018-05-10T04:27:51.337

" It will be easier to transition from a University environment to an Industrial one having done several assignments in Python and having a clear understanding of all the tools it provides than if we continue using Java" - I read that as "hey I want to use Python because it has better tools making ML easier". – solarflare – 2018-05-10T04:32:09.350

Yea, I can't say I agree with this. You can be as low-level or abstracted as you please. The amount of learning in that case is based on personal self-awareness. For a university course knowing what you don't understand and what you need to improve on is extremely important – hisairnessag3 – 2018-05-10T05:42:04.883


To add a few cents, I do not think it will make any difference. The reason is that the content of the course will be, by design (if you can teach it using java), very general, general enough so it will not matter what language you use (this has to be so otherwise you would not be able to use Java). Once you need to do advanced stuff and want to automatize the basic algorithms, you can switch to python, where you can use super advanced API's like Keras, which is on top of tensorflow which is on top of python. To give you a particular example, with full time dedication you should be able to switch from matlab to python and implement your first keras model, by self learning, in not more than a couple of months.

Hugh Mungus

Posted 2018-05-09T13:58:33.037

Reputation: 98