Tola
Tola

Reputation: 2421

Microsoft VB.NET naming convention

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.

Upvotes: 15

Views: 19043

Answers (5)

Rick Rat
Rick Rat

Reputation: 1732

I use this guide on "net Naming Conventions and Programming Standards - Best Practices": http://10rem.net/articles/net-naming-conventions-and-programming-standards---best-practices

Upvotes: 4

Tamas Czinege
Tamas Czinege

Reputation: 121294

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

Upvotes: 11

Ðаn
Ðаn

Reputation: 10875

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

Upvotes: 1

Dillie-O
Dillie-O

Reputation: 29725

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.

Upvotes: 0

Mehrdad Afshari
Mehrdad Afshari

Reputation: 421978

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

Upvotes: 2

Related Questions