by ablob · 1mo ago · 0 comments
if (double.TryParse("5.x5", out double val)) { ...
which would be the C# equivalent double.TryParse("5.x5", out double val, out bool ok);
if (ok) { ... }
in case of a hypothetical variant of C# that doesn't have functions, only procedures, so you'd have to return the data from subroutine calls by ref/out/globals exclusively. It's still would be the same semantics — but quite different ergonomics.So out of those three choices: return all results by assigning to ref/out parameters; return one result directly, all other by assigning to ref/out parameters; return all results directly — I personally prefer the last one. Almost nobody prefers the first one, yet people seem to be strangely attached to the second variant for some reason.