The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
But if you need the postfix there is no way around that, you are dealing with two separate values....the initial value and the return value. With prefix the only thing that matters is the return value. You are talking as if they do the same thing only if you choose one it is less efficient, but they don't, they do different things so have different implementations.
Life is a dark, meaningless void.
We're thrust upon this coincidental floating space rock to live a meaningless life before we inevitably return to dust.
The question you should be asking me is if anything makes me happy at this point.
The answer is a resounding yes: bothering you about your single line if statements
While the article is correct for C it's not entirely correct for C#. C# actually defines the order of execution to be Left-associative or Right-associative depending on the operator. C# operators - C# reference | Microsoft Docs[^]
Microsoft's C# compiler as a rule, does barely anything to optimize, punting it all to the jit compiler, which does peephole optimizations. It *may* optimize those out, and it may not. NGen'd assemblies might, but that's a different story.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
Last Visit: 28-Feb-20 22:08 Last Update: 28-Feb-20 22:08