Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 539
Tola Avatar asked Mar 20 '09 21:03

Tola


People also ask

What are 4 rules for naming variables in Visual Basic?

Use the following rules when you name procedures, constants, variables, and arguments in a Visual Basic module: You must use a letter as the first character. You can't use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name. Name can't exceed 255 characters in length.

What are the VB 6 variable naming conventions?

The naming rules for variables in VB are as follows: the name must begin with a letter, followed by 0 or more letters, numbers, and/or underscore characters. the name may not contain spaces. the name cannot be a keyword.

What is a good file naming convention?

File naming best practices:Files should be named consistently. File names should be short but descriptive (<25 characters) (Briney, 2015) Avoid special characters or spaces in a file name. Use capitals and underscores instead of periods or spaces or slashes.

What is the convention for naming variables?

The variable name must start with an alphabetic character, then it can consist of characters A-Z, 0-9, @, #, _ and the special characters £ and $.


2 Answers

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
like image 85
Tamas Czinege Avatar answered Sep 23 '22 06:09

Tamas Czinege


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

like image 38
Rick Rat Avatar answered Sep 22 '22 06:09

Rick Rat