Should I use int or Int32

前端 未结 30 2449
野性不改
野性不改 2020-11-22 11:52

In C#, int and Int32 are the same thing, but I\'ve read a number of times that int is preferred over Int32 with no reason

30条回答
  •  [愿得一人]
    2020-11-22 12:29

    In my experience it's been a convention thing. I'm not aware of any technical reason to use int over Int32, but it's:

    1. Quicker to type.
    2. More familiar to the typical C# developer.
    3. A different color in the default visual studio syntax highlighting.

    I'm especially fond of that last one. :)

提交回复
热议问题