Search code examples
c#variable-types

Should I use int or Int32


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 given. Is there a reason, and should I care?


Solution

  • ECMA-334:2006 C# Language Specification (p18):

    Each of the predefined types is shorthand for a system-provided type. For example, the keyword int refers to the struct System.Int32. As a matter of style, use of the keyword is favoured over use of the complete system type name.