Thread: Java vs C++
View Single Post
  #8   Spotlight this post!  
Unread 25-11-2010, 15:23
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,661
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Java vs C++

Quote:
Originally Posted by Robototes2412 View Post
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).
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub