3 ms·
I think what he meant is the different (implicitly assumed by human brain) output of those two statements: someList.Add(obj); someStr.Format(„%d“); While the
by chrisandchris 6y ago
I think what he meant is the different (implicitly assumed by human brain) output of those two statements:
someList.Add(obj);
someStr.Format(„%d“);
While the first one cleary modifies the list someList, the second one only _returns_ the modified string and someStr’s value does not change. IMHO fornatted text is a different (new) object therefore I don‘t see his issue, and I also think there‘s a shift towards immutable, which would clear such a thing up.
- fireattack 6y agoI feel like your example is talking about having the result "in-place" or not, which is an entirely different from what he's complaining (semicolon suspends output).
- chrisandchris 6y ago> In project programming this hit me this week with a bug: > value.Format(...); > return true; > when I actually wanted > return value.Format(...); > This is "implicit information loss" [..] I don‘t see any semicolon missing.
- fireattack 6y agoOh sorry, didn't notice you're talking about the first half of point #1. To be honest, I have no idea what he's expecting with that "return true". How would that be different in any other language?
- chrisandchris 6y agoI think he‘s expecting someStr.Format() to format the value of the object someStr _instead_ of returning a new object containing the fornatted string.