views:

1290

answers:

5

Is there any standard naming convention for VB.NET ?

Based your programming experiences, would like to share your naming convention for VB.NET ?

Are there any guides for this kind of good practice besides patterns & practices Guidance Explorer and Guidance Share ?

Thanks. Happy Weekend.

+2  A: 

VB.NET shares the naming convention of the .NET Framework. PascalCase for types and public stuff, camelCase otherwise.

Mehrdad Afshari
+4  A: 

I use this guide: http://www.irritatedvowel.com/Programming/Standards.aspx

Rick Ratayczak
+1 I frequently refer to this guide
Element
A: 

Take a peek at this question. It is essentially the same question regarding C#, however most of of the links and answers provided apply to both languages.

Dillie-O
+1  A: 

As Mehrdad said, VB.NET follows the General .NET naming conventions. More specificly:

  • Types, events, read-only static fields, methods, namespaces, properties: PascalCase
  • Parameters: camelCase
  • Acronyms of two characters: DB, with the exception of Id and Ok
  • Acronyms of three or more characters: Html or html, depending on context, but never HTML
  • Compound words: Hashtable, not HashTable, except for some common terms like FileName
  • Do not use separators like hyphens (-) or underscores (_) between words
  • Do not use Hungarian notation
DrJokepu
Actually, ID has a special rule and should be spelled Id according to the MS conventions. Other two-letter acronyms should be all uppercase, though.
erikkallen
@erikkallen: very true, i've corrected it. thanks.
DrJokepu
A: 

Enable Visual Studio "Code Analysis" to check your code against several Microsoft-sanctioned naming conventions.

Dan