View Single Post
  #5   Spotlight this post!  
Unread 12-05-2012, 19:22
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: Which language should we program in

Since we have a Java class at our school, Java is what we use.

Between Java and C++, most of the differences are noted by the always awesome WPILib people: Brad Miller, Ken Streeter, Beth Finn, Jerry Morrison, Dan Jones, Ryan O’Meara, Derek White, Stephanie Hoag, and Alex Henning.

Here are their words verbatim from page 10 of the PDF:

Quote:
Java
  • Objects must be allocated manually, but they are freed automatically when no references remain. (Garbage Collection)
  • References to objects instead of pointers. All objects must be allocated with the new operator and are referenced using the dot (.) operator. (e.g. gyro.getAngle() )
  • Header files are not necessary and references are automatically resolved as the program is built.
  • Only single inheritance is supported, but interfaces are added to Java to get most of the benefits that multiple inheritance provides.
  • Checks for array subscripts out of bounds, uninitialized references to objects and other runtime errors that might occur in program development.
  • Complies to byte code for a virtual machine, and must be interpreted. (Slightly less performance, but mostly unnoticeable)

C++
  • Memory allocated and freed manually. (Subject to memory leaks)
  • Pointers, references, and local instances of objects.
  • Header files and preprocessor used for including declarations in necessary parts of the program.
  • Implements multiple inheritance where a class can be derived from several other classes, combining the behavior of all the base classes.
  • Does not natively check for many common runtime errors.
  • Highest performance on the platform, because it compiles directly to machine code for the PowerPC processor in the cRIO.
Attached Files
File Type: pdf WPI Robotics Library User’s Guide.pdf (2.13 MB, 11 views)
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.