|
Re: Java vs C++
The JVM tends to be rather memory hungry. The reason there's no JRE for the Arduino is that Java simply takes too much RAM to run on the memory footprint of an ATMega part.
There are some Java implementations that are lean. The Dalvik VM found on Android platforms is one example. However, that VM uses a just-in-time (JIT) compiler (Android 2.2+) and a register-based VM rather than Oracle's stack-based VM. The register-based VM is more efficient and better suited to JIT compilation. However, these are the very reasons that Oracle is suing Google. Also, Oracle seems to be backing out on their support for open source Java solutions (just ask the Apache folks). So, the future of Java as anything other than a proprietary platform is in question at the moment.
On the other hand, C/C++ has been a standard for embedded development for almost 30 years and doesn't seem to be going away any time soon. In fact, most of the JVMs are written in C/C++. If limited memory footprints are in your future, then Java is not the solution.
All that being said, Java tends to work just fine for FRC robots. You're typically not running long enough for the garbage collection cycle to become an issue, and 64MBs of RAM is really quite a lot for many applications. The other advantage of Java is that it's the language used on the AP exams. So, many of your team may already have some Java experience.
I think it was summed up earlier in this thread, you go with what your team may already have experience with. C/C++ execution is arguably faster than Java, but FRC competitions are typically not won or lost on a microsecond scale. The additional complexity of C/C++, while it may make them arguably more employable in the embedded marketplace, can be daunting for first-time developers.
HTH,
Mike
|