πŸ˜…
@nixCraft
C programmer here. Luckily there is no pass by reference in C πŸ€—. Also please use pass by copy as often as possible. It makes things much more easy to debug.
@fneddy @nixCraft C is easy also, const ref if you don't mutate, ref if you do, pointer if you're interopping with C
@nixCraft do people actually do non global variables in bash scripts??? Asking for a neutral friend...

@ubernetes @nixCraft

At that stage, you normally change the language. Perl or python, for example.

@nixCraft and smart pointers…

@nixCraft aahh, so lame here.

I expected to see some kind of 'is NULL a value?' typish flame-war. (context: SQL, not C preprocessor)

@nixCraft Easy:

if (the function will consume/own the object) { pass instance using move-construction; } else if (the function will keep a reference that it does not own) { pass by std::shared_ptr or possibly std::weak_ptr; } else if (the parameter is optional) { pass by pointer and check for null; } else { pass by reference; }
@gantua @nixCraft pass small values by value so that they can be passed in registers rather than via memory.
@juliank @nixCraft Then the function must also return the modified value. It may be a bit cumbersome to use.
@nixCraft wait? There is a difference? 
@nixCraft so much easier in rust! the compiler will complain if you use the wrong one or use it in an unsafe way