Does variable name length matter for performance C#?

前端 未结 6 2325
别那么骄傲
别那么骄傲 2021-02-18 22:28

I\'ve been wondering if using long descriptive variable names in WinForms C# matters for performance? I\'m asking this question since in AutoIt v3 (interpreted language) it was

6条回答
  •  日久生厌
    2021-02-18 22:54

    It doesn't matter. Eventhough you Can get the names when decompiling (see other posts for details) those names are not used by the IL instruction Reading from or writing to variables/fields. The variables and fields are identified through a different construct. In the reflection.emit namespace these are represented by LocalBuilder (for a local variable or FieldBuild for fields) and to further stress the point: they don't even need to be explicitly named.

提交回复
热议问题