Hi. I read something interesting in Bjarne Stroustroup's book. He discourages using functions that modify call-by-reference arguments. He claims that they make programs hard to read.
I was surprised by this. I didn't learn this, and always learned that to modify a variable one had to use reference arguments. Passing-by-value provided one with a copy (I assume this involves the Copy Constructor), which does not persist.
Later Mr. Stroustroup declares, "Be suspicious of non-const reference arguments; if you want the function to modify its arguments, use pointers and value return instead."
I would like to hear some opinions about this. Namely, do you feel that these make programs hard to read, and are they best avoided? Also, how would one "use pointers and value return instead," to accomplish this objective?
Thanks for the feedback. Steve