On Thursday, 30 October 2014 at 09:39:42 UTC, Ola Fosheim Grøstad wrote:
On Thursday, 30 October 2014 at 08:02:49 UTC, Paulo Pinto wrote:
3. No non-const ref parameters to functions, use pointers. They want a visible "&" at call site for output parameters. e.g. "read(&var)" so that you don't have to look the function up in the docs.


Coming from a Quick/Turbo Basic/Turbo Pascal background, I never understood the C culture about function parameters.

Just another example of C being unsafe.

C is unsafe, but it is desirable to make it visible at the call site that you are returning a value through a parameter.

"
Interviewer: Just a minute. What about references? You must admit, you improved on 'C' pointers.

Stroustrup: Hmm. I've always wondered about that. Originally, I thought I had. Then, one day I was discussing this with a guy who'd written C++ from the beginning. He said he could never remember whether his variables were referenced or dereferenced, so he always used pointers. He said the little asterisk always reminded him..
"

Reply via email to