Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System.String vs. string ?!?
Message
De
30/12/2004 01:16:57
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00973176
Message ID:
00973187
Vues:
18
Einar,

As BOb said, it doesn't matter which one you use and it's pretty much personal preference. I agree with the author of the article and prefer to use string and int versus System.String and System.Int32, because I think it's more readable.
System.String MyString = "Whatever";
// -or-
string MyString = "Whatever";

System.Int32 count = 0;
// -or-
int count =0;
Which do *you* think is more readable?

~~Bonnie

>I just got done reading some document containing coding guidelines for C# (Nothing official from M$ but most of it seemed pretty well thought through. Here is the link: http://home.comcast.net/~lancehunt/CSharp_Coding_Standards.pdf).
>Anywho, one of the things that struck me as odd in the document was that is person prefered using string instead for System.String, int instead of System.Int32, short instead of System.Int16 and so on.
>
>Does anyone know of a good (i.e. better than less to type) reason to use built-in C# data type aliases (string,int, short, long) instead of the .NET common type system (System.String, System.Int32, System.Int16, System.Int64)?
>
>I have gotten used to use the .NET common type system, mostly because of intellisense and the fact that I can type "System." pretty darn fast <s>, but also because I thought that was the more correct way to code.
>
>Any thoughts on this issue would be appreciated.
>
>Thanks,
>Einar
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform