Had another conversation about pass-by-ref vs pass-by-value and why passing an object in something like C# or JS doesn't copy the object. Feels like this comes up every few months.

Always takes a bit of a struggle to explain what a pointer is to someone who's programmed for years without ever using one directly.

Obviously not a big problem, but it always makes me wonder what actually makes for the better abstraction.

@slembcke They've never modified a struct and wondered why the change isn't visible up the stack?
( I label my structs SName nowardays because otherwise they appear to be objects to all intents and purposes unless you look at the definition )
@toerror Oh, no that's exactly it. This time the conversation went something like "I always forget that (C#) objects are pass-by-reference and structs are pass-by-value." Which then led into further confusion about what an object reference/pointer/whatever was vs what pass-by-reference means. I brought up the idea of using the ref keyword on a object, and what that would do. There was a bit of an "oooooh..." moment.
@slembcke @toerror i once made a small language where each function had two argument lists, one for passing by value, and another for by ref, so it was clear even at call site which is which
@slembcke @toerror so declaration was something like `func f(int byval)(int byref)`, and then call would be `byref.f(byval)`, a little awkward, but clear once you get used to it
@bcace @toerror How do you pass the byref argument?
@slembcke @toerror that's the `byref` in `byref.f(byval)`, you can have multiple byref args in declaration: `func f()(int byref1, int byref2)`, and at call site: `(var1, var2).f()`
@slembcke @toerror and if it's a func with only byval args then it's just `func f(int byval)`, and then call `f(var1)`