Subscribe to our Newsletter

Java versus Python

Originally posted on Data Science Central

Interesting picture that went viral on Facebook. We've had plenty of discussions about Python versus R on DSC. This picture is trying to convince us that Python is superior to Java. It is about a tiny piece of code to draw a pyramid.

This raises several questions:

  • Is Java faster than Python? If yes, under what circumstances? And by how much? 
  • Does the speed of an algorithm depend more on the design (quick sort versus naive sort) or on the architecture (Map-Reduce) than on the programming language used to code it?
  • For data science, does Python offer better libraries (including for visualization), easier to install, than Java? What about the learning curve?
  • Is Java more popular than Python for data science, mathematics, string processing, or NLP?
  • Is it better to write simple code (like the Java example above) or compact, hard to read code (like the Python example). You can write Python code that is much longer for this pyramid  project (like the Java example) but far easier to read, yet executes just as fast. The converse is also true. What are the advantages of writing the compact, hard-to-read code?

Related article:

DSC Resources

Additional Reading

Follow us on Twitter: @DataScienceCtrl | @AnalyticBridge

E-mail me when people leave their comments –

You need to be a member of Hadoop360 to add comments!

Join Hadoop360


  • Thank you for sharing great article related to Python vs java. I have shared some important points which help you to know python vs. java.

    What Is The Difference Between Python And Java?
    Python vs. Java - What Is The Difference Between Python And Java? - Python vs. Java – Comparison Points
  • I also have question regarding the programming languages used. Is R language is better or both?

    SAS vs r

This reply was deleted.

Featured Blog Posts - DSC