Some suggestions on C # naming specification

Source: Internet
Author: User

1. The best format for namespace in <Company>.<Component>

2. Consider whether you need to set namespace to a complex number, such as System.Collections in the FCL

3. Avoid naming your own type with the type name of the FCL

4. Class names are best used in nouns

5. Interface names preferably with adjectives

6. The name of the derived class is suffixed with the base class name

7. Generic type parameters are prefixed with T

8. Enumeration type name should be plural

9. Properties, fields, and methods that are open to the caller should be named Pascal

10.bool attributes are generally named for affirmative phrases, such as isenabled

11. Delegate or event naming should be added: Delegate,callback,eventhandler and other descriptions

12. Variables of a delegate or event type use verbs or adjectives

13. A way to do only one thing

14. Avoid too long classes, or methods

15. Don't be public.

16. Refactoring multiple properties to a class

17. Do not have duplicate code

18. Ways to use lambda instead of short content

19. Add comments to custom throw exceptions

20. Do not over-design, agile

21. Focus on Unit Testing

Some suggestions on C # naming specification

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.