|
Re: Seeking advice for rookie programming
Quote:
Originally Posted by MamaSpoldi
[*]If you already know Java, C++ is the next step in your learning process. I think the biggest mindset change is that C++ is pass by value and Java is pass by reference. This is related to pointers (indirectly) and it basically means that you cannot modify a parameter to a C++ routine unless you pass a pointer to the value.
|
This is not quite right - java is actually pass-by-value; when passing objects it passes the value of the reference (not the reference itself!). If you reassign a passed parameter in a java subroutine, it will not change anything outside of the subroutine.
(I've heard some object to this by arguing that it is indeed pass-by-reference, but variable assignment in java is best interpreted as name-binding. But this is not how the language specification describes it.)
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"
Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016
Last edited by Oblarg : 12-19-2016 at 10:25 PM.
|