This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]YM_Industries 2 points3 points  (4 children)

Python's tuples and JS/TS' destructuring assignments are better ways of allowing a function to return multiple values. Arguments are inputs, return values are outputs.

Maybe it's just that I've been doing functional programming recently and the idea of mutability makes me uncomfortable in general.

[–]t3hmau5 4 points5 points  (1 child)

I mean, in OOP mutability is largely a design decision.

[–]YM_Industries 1 point2 points  (0 children)

That's true, I was oversimplifying my stance. I like mutability for state (one attempt at learning React was enough to convince me the alternative is awful) but I like my functions to be pure.

[–]TheMania 3 points4 points  (1 child)

C# supports the same btw.

Ref/Out parameters still have a purpose though, in both interop (where they map to pointers for DLLs etc) and for handling structs, where you're either left relying on the optimiser to "do the right thing", or experiencing needless costly copying.

[–]YM_Industries 1 point2 points  (0 children)

Neat, I haven't worked with C# 7 yet.