Go Down

Topic: Java - Python (Read 863 times) previous topic - next topic

Delta_G

Nov 01, 2019, 05:30 pm Last Edit: Nov 01, 2019, 05:35 pm by Delta_G
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.

...R
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. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Delta_G

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. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Robin2

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

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up