Use C # as an example to describe naming conventions

Source: Internet
Author: User
To C # Naming Conventions

Follow pascalcasing principles

Class Name: directly composed of nouns or noun phrases. Example: Class

Attribute: directly composed of nouns or noun phrases. Example: Name

Interface: It is composed of uppercase letters I and verbs or verb phrases. For example, igetallbookinfo.

Follow

Camelcasing rules

Private variable: it cannot contain data types. It is often prefixed with an underscore. For example, _ studentname.

Local variables and parameters: they cannot contain data types, such as studentnum.

Special: 1. The name of the event and the delegate: usually use a verb or verb phrase. Use the current time and past time to mark the sequence of events.

Use the suffix of eventhandler for delegation. Follow the pascalcasing principle, for example, getallbookinfoeventhandler. The event is suffixed with eventargs,

Follow the pascalcasing principle, for example, getnameeventargs.

2. Names of file names are similar.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.