Bob Grommes <bo*@bobgrommes.com> wrote:
They are completely interchangeable and generate the same IL code.
I believe that most C# coders use the C# keywords -- probably because of the
consistency with C-family syntax (all lower case). It's really a matter of
your personal preference, but I lean towards being consistent with the ethos
of the C# language, and with common usage -- it makes it easier to work with
others.
Whatever you decide to do, it's best in my view to be consistent one way or
the other in your own usage.
Indeed. The other thing to consider is that for method names, you
should stick to the real type name rather than the C# version, so that
people using your code from other languages won't get confused. So,
you'd have:
GetSingle
instead of
GetFloat
and
GetInt32
instead of
GetInt
Of course, if your code is never going to be called elsewhere, you may
decide to ignore this - but then if you ever *do* write code which is
going to be called from elsewhere, you'll end up being inconsistent
either for other languages or for other existing methods you've
written.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too