Reference variables were created in C++.  They are a means of simplifying
pointers.  They are a means of using pointers where you don't have to
dereference the variable.  However, you also lose the power to change
what the reference points to.

They're both good and bad.  Good because they're convenient, bad because
sometimes you forget something is a reference rather than a regular
variable so you may forget that your local changes actually affect the
calling function as well.  This also makes it a pain to follow someone
else's code when they use input parameters as references and modify
them inside the function.  Yes, it's convenient for programming, but
figuring out what someone else was doing with a side effect like this
can be difficult. 


~Patrick

Reply via email to