Quote:
Originally Posted by Robototes2412
Pros for Java:
1. Garbage Collector
2. no pointers
Pros for C++:
1. More control
2. Pointers (a two-edged sword)
|
Technically every reference that's passed around in Java IS a pointer under the covers. The big difference is that the developer doesn't have to worry about pointers vs. pass-by-reference (i.e. whenever you see a '&' in front of a variable name that represents a large quantity of data). Java handles it all; C++ allows more control.
In the FRC world, I'm not sure what the difference is. In industry, Java is hardware and operating system independent so long as a JVM exsists (Sun/Oracle provides the JVM), where a C++ must be compiled specifically for a platform and even a specific version of the platform. This means that Java developed for Linux typically also works in Windows (ignoring any full-path file system stuff). It also means that C++ can go on more systems than Java since Sun/Oracle doesn't create a JVM for all platforms (such as embedded platforms like an Arduino).