Does using parentheses around return values provide any compiler-related benefits?

后端 未结 2 662
被撕碎了的回忆
被撕碎了的回忆 2020-12-20 16:21

Was just watching a video of a rather great Microsoft instructor, Mike Taulty. In his videos he consistently surrounded his return values with parentheses, even single valu

2条回答
  •  再見小時候
    2020-12-20 16:40

    There is certainly no performance difference because both forms translate to the same IL. The runtime couldn't tell even if it wanted. You can use Reflector or ILdasm or any other decompiler to look at the generated IL.

    There is no intellisense benefit or detriment.

    The semantics are also exactly identical.

    I will not discuss whether it is better style or not because that discussion does not belong on Stack Overflow. It is also a matter of personal taste.

提交回复
热议问题