Should I use int or Int32

前端 未结 30 2193
野性不改
野性不改 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:37

    I use int in the event that Microsoft changes the default implementation for an integer to some new fangled version (let's call it Int32b).

    Microsoft can then change the int alias to Int32b, and I don't have to change any of my code to take advantage of their new (and hopefully improved) integer implementation.

    The same goes for any of the type keywords.

提交回复
热议问题