Giter Club home page Giter Club logo

vb_examples's Introduction

vb examples

Small examples of Visual Basic (VB.NET) code

VB naming conventions

General Rules

  • Begin each separate word in a name with a capital letter: WriteExample
  • When you name an element in your Visual Basic application, the first character of that name must be an alphabetic character or an underscore.
  • An element name must only contain alphabetic characters, decimal digits, and underscores.
  • An element name must contain at least one alphabetic character or decimal digit if it begins with an underscore.
  • An element name must not be more than 1023 characters long.
  • If an event has a concept of "before" or "after," use a suffix in present or past tense: ControlAdd or ControlAdded
  • For long or frequently used terms, use abbreviations to keep name lengths reasonable.
  • Variable names greater than 32 characters are difficult to read on a monitor set to a low resolution.
  • Make sure your abbreviations are consistent throughout the entire application.
  • Avoid using names in an inner scope that are the same as names in an outer scope. If a conflict occurs between a variable and the keyword of the same name, you must identify the keyword by preceding it with the appropriate type library. For example, if you have a variable called Date, you can use the intrinsic Date function only by calling DateTime.Date.
  • Do not use "My" or "my" as part of a variable name
Element Notation Example Notes
Class PascalCase (UpperCamelCase) ClassName Begin with a noun. In names of event argument classes, include the "EventArgs" suffix.
Constant camelCase (lowerCamelCase) constName
Event handler PascalCase (UpperCamelCase) MouseEventHandler Begin names with a noun describing the type of event followed by the "Handler" suffix.
Function/Method PascalCase (UpperCamelCase) RunFunction Begin function and method names with a verb.
Interface PascalCase (UpperCamelCase) IComponent, IPersistable Begin interface names with the prefix "I", followed by a noun or a noun phrase, or with an adjective describing the interface's behavior. Do not use the underscore, and use abbreviations sparingly because abbreviations can cause confusion.
Module PascalCase (UpperCamelCase) ModuleName Begin with a noun.
Property PascalCase (UpperCamelCase) PropertyName() Begin with a noun.
Structure PascalCase (UpperCamelCase) StructureName Begin with a noun.
Variable camelCase (lowerCamelCase) variableName

Comment conventions

  • Put comments on a separate line instead of at the end of a line of code.
  • Start comment text with an uppercase letter, and end comment text with a period.
  • Insert one space between the comment delimiter (') and the comment text.
' Here is a comment.

Sources

Support

If you find these examples useful you can star this repo.

vb_examples's People

Contributors

rubenhortas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.