Stuart Dootson wrote: if that's the case, then C# always passes ref types by reference
Java) pass all objects as references, (the reference to the object is passed by value). On the other hand,
C++ makes a copy of an object passed by value.
Stuart Dootson wrote: what's the difference between ref and non-ref.
void foo(Goo goo)
can change the state of the object referenced by
goo (similar to
C++ reference or pointer to the object).
void fooWithSuperpowers(ref Goo goo)
goo itself, i.e.
goo may be a reference to another object after function call (similar to a double indirection in
Stuart Dootson wrote:Can we just agree that C# is fundamentally wrong and be done with it
Stuart Dootson wrote:Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Java, C#, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke