상세 컨텐츠

본문 제목

Microsoft C Coding Standards Document

카테고리 없음

by exarcachi1983 2021. 6. 1. 19:02

본문

  1. Microsoft C Coding Standards Document Online
  2. Javascript Coding Standards Document
Active1 year, 11 months ago

Version 1.5 Why create yet another coding standard document? There have been numerous attempts to document C# Coding Standards since the language was released, but most are either overly verbose, too restrictive, or try to cover every single scenario. To that end, this document lays out foundational standards for writing Objective C and C code in our project. The Objective C guidance in this document is meant to augment existing industry guidance, so please read through Apple's Coding Guidelines for Cocoa before digesting the rest of the standards outlined below. 1 – IDesign C# Coding Standards. IDesign C# coding standards is a pretty decent and compact (27 pages) Coding Standards Document. It covers a Naming conventions, Best practices and Framework specific guidelines. Example: The document even has guidelines for project settings, build configuration, versioning etc. Good work by IDesign guys. Nov 16, 2010  1 – IDesign C# Coding Standards. IDesign C# coding standards is a pretty decent and compact (27 pages) Coding Standards Document. It covers a Naming conventions, Best practices and Framework specific guidelines. Example: The document even has guidelines for project settings, build configuration, versioning etc. Good work by IDesign guys. Mar 16, 2016  To that end, this document lays out foundational standards for writing Objective C and C code in our project. The Objective C guidance in this document is meant to augment existing industry guidance, so please read through Apple's Coding Guidelines for Cocoa before digesting the rest of the standards outlined below.

Is there a Coding Standard document available for download from Microsoft ? I want to use their standards, mainly for C#.

CJBS
10.4k4 gold badges58 silver badges103 bronze badges
ErezErez
2,9379 gold badges62 silver badges113 bronze badges

6 Answers

If you're using C#, you can learn Microsoft's preferred style as you code by running StyleCop on any code that you write. It's a lot easier to learn that way than trying to absorb some huge document.

Jonny CundallJonny Cundall

Also look at Microsoft Developer Center: Patterns and Practices, though some of that is more high-level than just coding standards.

DaleDale
9,1118 gold badges47 silver badges81 bronze badges
user151323

The patterns & practices Guidance Explorer

'is a tool that enables discovery, composition and consumption of high quality development guidance. Guidance Explorer installs with a connection to the patterns & practices guidance library including performance and security topics for .NET, ASP.NET, and ADO.NET applications. The guidance library contains a variety of guidance types including checklists and guidelines covering design, implementation and deployment topics.'

So, this will be a bit friendlier than one big document and will let you:

  • Find relevant patterns & practices guidance
  • Build customized checklists for your development scenarios
  • Build customized guidelines for your development scenarios
  • You can build custom sets of guidance and share with your team as recommended practice.
  • Subscribe to an RSS feed of guidance
rohancraggrohancragg
4,1444 gold badges30 silver badges44 bronze badges

MSDN is a great place to start a search for anything related to programming on Windows. You can start with:

Computer software for ghost hunters. Paranormal Software. For investigators, amateurs and ghost tours worldwide. We create advanced software for both professionals and amateurs including Paranormal Investigators / Researchers, Ghost Tours and Ghost hunters for iOS, Android and PC/Windows. You will find our popular apps on the App store, Google Play, Amazon App store and our own. Apr 12, 2016  Furthermore, its creator – a ghost hunter named Dennis A. Batchelor – claims that it is the #1 paranormal software of choice for ghost hunters around the world. This ghost hunting computer software is designed to help users bring all of their data together so. Ghost Hunting Audio Analyzing Software Purchase Audio Analyzing Software directly or visit our store of over 100 ghost hunting tools! Audio Analyzing Software - Be sure to check out our audio analyzing software store page, as we just published a free audio analyzing software for ghost hunting.That's right ghost hunters, totally free. Ghost Hunting Apps for Windows, Paranormal Apps for Windows, GhostHunterApps.com makers of the SCD1, IB1, Realm Ghost Box, Ethereal Ghost Box, Gaia Divination, GB-1 Ghost Box, GB-RIFT Ghost Box, Spirit Radar, Spirit Box, Q3 Meter, EVP Analyzer. Ghost Hunting Software for Windows. Download ghost hunting software for pc for free. Development Tools downloads - Ghost Hunter by RB59.com Software and many more programs are available for instant and free download.

Remember there is no one size that fits all and conventions/standards change from team-to-team, language being used etc. Password decrypter free.

dirkgentlydirkgently
93.5k16 gold badges115 silver badges177 bronze badges

If you wants guidelines published by Microsoft, google them or use links in other answers.

But if you want 'standards used in Microsoft's own code' - there isn't a single answer. Microsoft is a big company with many divisions and acquired code, so each project or product has it's own style.

Even style of .NET Framework itself is slightly different from what StyleCop suggests.

My point is, paying more attention to those guidelines and white papers than Microsoft itself does might be not be a good idea.

imaima
6,6973 gold badges17 silver badges18 bronze badges

Not the answer you're looking for? Browse other questions tagged c#.netcoding-style or ask your own question.

Object NameNotationLengthPluralPrefixSuffixAbbreviationChar MaskUnderscores
Class namePascalCase128NoNoYesNo[A-z][0-9]No
Constructor namePascalCase128NoNoYesNo[A-z][0-9]No
Method namePascalCase128YesNoNoNo[A-z][0-9]No
Method argumentscamelCase128YesNoNoYes[A-z][0-9]No
Local variablescamelCase50YesNoNoYes[A-z][0-9]No
Constants namePascalCase50NoNoNoNo[A-z][0-9]No
Field namecamelCase50YesNoNoYes[A-z][0-9]Yes
Properties namePascalCase50YesNoNoYes[A-z][0-9]No
Delegate namePascalCase128NoNoYesYes[A-z]No
Enum type namePascalCase128YesNoNoNo[A-z]No

1. Do use PascalCasing for class names and method names:

Why: consistent with the Microsoft's .NET Framework and easy to read.

2. Do use camelCasing for method arguments and local variables:

Why: consistent with the Microsoft's .NET Framework and easy to read.

3. Do not use Hungarian notation or any other type identification in identifiers

Why: consistent with the Microsoft's .NET Framework and Visual Studio IDE makes determining types very easy (via tooltips). In general you want to avoid type indicators in any identifier.

4. Do not use Screaming Caps for constants or readonly variables:

Microsoft

Why: consistent with the Microsoft's .NET Framework. Caps grab too much attention.

5. Use meaningful names for variables. The following example uses seattleCustomers for customers who are located in Seattle:

Why: consistent with the Microsoft's .NET Framework and easy to read.

6. Avoid using Abbreviations. Exceptions: abbreviations commonly used as names, such as Id, Xml, Ftp, Uri.

Why: consistent with the Microsoft's .NET Framework and prevents inconsistent abbreviations.

7. Do use PascalCasing for abbreviations 3 characters or more (2 chars are both uppercase):

Why: consistent with the Microsoft's .NET Framework. Caps would grab visually too much attention.

8. Do not use Underscores in identifiers. Exception: you can prefix private fields with an underscore:

Why: consistent with the Microsoft's .NET Framework and makes code more natural to read (without 'slur'). Also avoids underline stress (inability to see underline).

9. Do use predefined type names (C# aliases) like int, float, string for local, parameter and member declarations. Do use .NET Framework names like Int32, Single, String when accessing the type's static members like Int32.TryParse or String.Join.

Why: consistent with the Microsoft's .NET Framework and makes code more natural to read.

10. Do use implicit type var for local variable declarations. Exception: primitive types (int, string, double, etc) use predefined names.

Why: removes clutter, particularly with complex generic types. Type is easily detected with Visual Studio tooltips.

11. Do use noun or noun phrases to name a class.

Microsoft C Coding Standards Document Online

Why: consistent with the Microsoft's .NET Framework and easy to remember.

12. Do prefix interfaces with the letter I. Interface names are noun (phrases) or adjectives.

Why: consistent with the Microsoft's .NET Framework.

13. Do name source files according to their main classes. Exception: file names with partial classes reflect their source or purpose, e.g. designer, generated, etc.

Microsoft coding standards document

Why: consistent with the Microsoft practices. Files are alphabetically sorted and partial classes remain adjacent.

Javascript Coding Standards Document

14. Do organize namespaces with a clearly defined structure:

Why: consistent with the Microsoft's .NET Framework. Maintains good organization of your code base.

15. Do vertically align curly brackets:

Microsoft coding standards document

Why: Microsoft has a different standard, but developers have overwhelmingly preferred vertically aligned brackets.

16. Do declare all member variables at the top of a class, with static variables at the very top.

Why: generally accepted practice that prevents the need to hunt for variable declarations.

With an assortment of recently added features which lets you create changes in a photograph from all potential outlook.It moves measures forward compared to prior versions. Adobe cc amtlib crack.

17. Do use singular names for enums. Exception: bit field enums.

Why: consistent with the Microsoft's .NET Framework and makes the code more natural to read. Plural flags because enum can hold multiple values (using bitwise 'OR').

18. Do not explicitly specify a type of an enum or values of enums (except bit fields):

Why: can create confusion when relying on actual types and values. The iliad pdf robert fagles read.

19. Do not use an 'Enum' suffix in enum type names:

Why: consistent with the Microsoft's .NET Framework and consistent with prior rule of no type indicators in identifiers.

20. Do not use 'Flag' or 'Flags' suffixes in enum type names:

Why: consistent with the Microsoft's .NET Framework and consistent with prior rule of no type indicators in identifiers.

21. Do use suffix EventArgs at creation of the new classes comprising the information on event:

Why: consistent with the Microsoft's .NET Framework and easy to read.

22. Do name event handlers (delegates used as types of events) with the 'EventHandler' suffix, as shown in the following example:

Why: consistent with the Microsoft's .NET Framework and easy to read.

23. Do not create names of parameters in methods (or constructors) which differ only by the register:

Why: consistent with the Microsoft's .NET Framework and easy to read, and also excludes possibility of occurrence of conflict situations.

24. DO use two parameters named sender and e in event handlers. The sender parameter represents the object that raised the event. The sender parameter is typically of type object, even if it is possible to employ a more specific type.

Why: consistent with the Microsoft's .NET Framework

Why: consistent with the Microsoft's .NET Framework and consistent with prior rule of no type indicators in identifiers.

25. Do use suffix Exception at creation of the new classes comprising the information on exception:

Why: consistent with the Microsoft's .NET Framework and easy to read.

26. Do use suffix Any, Is, Have or similar keywords for boolean identifier :

Why: consistent with the Microsoft's .NET Framework and easy to read.

Offical Reference

댓글 영역