When does it matter whether you use int versus Int32, or string versus String?

前端 未结 8 722
慢半拍i
慢半拍i 2021-01-19 14:02

In C#, the keywords for built-in types are simply aliases for corresponding types in the System namespace.

Generally, it makes no difference whether yo

8条回答
  •  失恋的感觉
    2021-01-19 14:47

    C# doesn't require you to use one or the other as they are equivalent. It is a personal preference and coding convention. So use the one that seems more readable to you and your team. Just one advice: be consistent: do not use an alias in half of your codebase and the full type name in the second half.

提交回复
热议问题