Rory Primrose

Learn from my mistakes, you don't have time to make them yourself

View project on GitHub

Coding standards - String vs string etc

I recently posted about some coding standards I have been reviewing. There is another standard that has plagued me where my research doesn’t really offer any solid guidance.

It is the old argument of:

  • string vs String
  • bool vs Boolean
  • int vs Int32
  • long vs Int64

The reason I like the String/Boolean option is because the colour coding in the IDE clearly identifies the text as a type rather than a C# keyword. That being said, I still tend to use int and long, but then revert to String and Boolean. One reason that Int32/Int64 is better would be that the meaning of int/long may change with the platform (I think this is right, someone please confirm) whereas Int32 and Int64 have static meanings.

Any thoughts?

Written on August 3, 2007