Should I use int or Int32

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

    I'd recommend using Microsoft's StyleCop.

    It is like FxCop, but for style-related issues. The default configuration matches Microsoft's internal style guides, but it can be customised for your project.

    It can take a bit to get used to, but it definitely makes your code nicer.

    You can include it in your build process to automatically check for violations.

提交回复
热议问题