View Single Post
  #19   Spotlight this post!  
Unread 12-03-2016, 21:13
axiomofdarkness's Avatar
axiomofdarkness axiomofdarkness is offline
Registered User
FRC #1403 (Cougar Robotics)
Team Role: Alumni
 
Join Date: Mar 2015
Rookie Year: 2013
Location: United States
Posts: 21
axiomofdarkness has a spectacular aura aboutaxiomofdarkness has a spectacular aura aboutaxiomofdarkness has a spectacular aura about
Re: Preferred Programming Language

Quote:
Originally Posted by MamaSpoldi View Post
Sorry but I differ with you on some points here. Syntactically C++ is a superset of Java... you could almost say that if you put C and Java it gives you an approximation of C++.

However, I would agree that Java has different conventions that are followed for coding standards and there are differences in the "default behaviors" of the code between C++ and Java as well. For example, C++ uses a "call by value" interface and Java uses "call by reference", meaning that one (C++) requires the use of pointers to allow a function to modify a value passed in and the other (Java) always implicitly passes a pointer (which can also be termed a "reference") and therefore any changes made to a parameter value inside a function modify persist after the function returns.

My point is that if you understand the underlying assumptions (which are always important regardless of the language you are using) in C++ and Java, you are likely to see them as much more similar than they are different. And the advantage of learning them both is that it provides you with perspective on the trade-offs of their variations in programming style.
Just a note: Java actually only supports passing by value, while C++ actually supports both passing by value and passing by reference.