Zachery Hysong wrote:
the concept of having to write `ref` twice seems counterintuitive to me.
The first time (in the method declaration) you use it to explain to the compiler that you're passing the string by reference, not as a value. The second could be omitted if the language would allow it; it doesn't because it helps to determine what is being passed. If you read the call to the method, then without the additional "ref" keyword it'd be impossible to say whether it is passed as a value or a reference without looking up the method-signature. It also prevents mistakes; you can never pass in a value by "mistake" :)
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]