Thread: Java or C++
View Single Post
  #12   Spotlight this post!  
Unread 22-05-2013, 00:25
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 486
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Java or C++

Quote:
Originally Posted by Jon Stratis View Post
Java, by default, uses Pass by Reference (although you can easily make a new object to make it work the same as Pass by Value), while C++ uses Pass by value (Although with pointers C++ can do Pass by Reference).
It's time for me to be the pedantic guy: Java uses pass by value for primitive types and by reference for all others. This is not merely a default: it cannot be changed (The ugly work-around of the caller copying arguments does work, of course). Also, for passing references in C++, I recommend: the language feature called "references"

On a different note, it's interesting to hear that the Java and C++ WPIlib impelemtations are equally buggy. I had assumed that the C++ one must be worse because the code looks like it was written by someone who wanted to be writing Java.