Java - Python

Pulled this off another thread so as not to hijack

I love the idea of the Java runtime - but not the Java language. In the past I programmed with JRuby. Python provides much the same cross-platform ability as the Java runtime and it is more commonly used than JRuby. But Python won’t work on an Uno so I use C++ for my Arduino code.


I think it depends on what you know best. Like I prefer English because it’s the language I grew up with. My Mexican friend prefers Spanish for the same reason. We both understand both, but differ in preference. Our conversations are confusing though because we are speaking two different languages. Listen in Spanish and respond in English or vice versa.

To me (learned java and c++ first) python syntax seems ambiguous. I like the strongly typed languages better. Though I still do code a lot in Python just because there’s less to “set up” to make something work. And things tend to get done with less typing of lines of code.

But that’s just like my opinion man. Everyone is welcome to their own.

PS. Didn’t post this to start a Java vs Python war. Just wondered what different people think are advantages and disadvantages of each. And when you prefer one to the other.

My preferred language is Ruby. But the Ruby "infrastructure" is poor - getting it to work on a PC can be hard work. JRuby (which is a version that works on the JRE) solves most of those problems as well as giving access to lots of Java libraries.

But Ruby is not nearly as widely used as Python (and JRuby is an even narrower subset).

Unlike the Ruby developers, the Python folks realized that for it to be popular it also has to be convenient. Most Python code runs unchanged on Linux and Windows, and even on an Android device (I don't have a MAC for testing). For example the same PySerial works on both Windows and Linux whereas you need different versions with Ruby. And most of the Python libraries can be included in a project so it has no external dependencies other than the Python interpreter.

I presume C++ for a PC would need to be compiled differently for Windows and for Linux so I couldn't give C++ code to Granny Jones and expect her to be able to run it. With code that uses the JRE, or Python that's no problem as long as the PC has the JRE or the Python interpreter installed.

And, perhaps most important, as you have so eloquently said " just because there's less to "set up" to make something work. And things tend to get done with less typing of lines of code."