Code style guide C Code Style Guide Version Mark Dellacca CC Code Style Guide Introduction Style Guide Source File Organization One Class per File Ordering Namespace and Using Statements XML Documentation Class and Interface Declaration Indentation Line L
C Code Style Guide Version Mark Dellacca CC Code Style Guide Introduction Style Guide Source File Organization One Class per File Ordering Namespace and Using Statements XML Documentation Class and Interface Declaration Indentation Line Length Wrapping Lines Comments Implementation Comment Formats Block Comments Single-Line Comments Trailing Comments Code-Disabling Comments Documentation Comments Comment Tokens - TODO HACK UNDONE Declarations Number Per Line Initialization Placement Class and Interface Declarations Properties Statements Simple Statements Compound Statements return Statements if if-else if else-if else Statements for Statements while Statements do-while Statements switch Statements try-catch Statements White Space Blank Lines Blank Spaces Naming Rules Methods Variables Parameters Tables II - CC Code Style Guide Microsoft SQL Server General ? Abbreviations Capitalization Practices Design Rules and Heuristics Providing Access to Instance and Class Variables Literals Variable Assignments Parentheses Parameters Returning Values Avoid excessive nesting using guard clause Debug Code Refactoring Conclusion III - CIntroduction C Code Style Guide Superior coding techniques and programming practices are hallmarks of a professional programmer The bulk of programming consists of making a large number of small choices while attempting to solve a larger set of problems How wisely those choices are made depends largely upon the programmer's skill and expertise This document addresses some fundamental coding techniques and provides a collection of coding practices The readability of source code has a direct impact on how well a developer comprehends a software system which in turn directly a ?ects project velocity Code maintainability refers to how easily that software system can be changed to add new features modify existing features ?x bugs or improve performance Although readability and maintainability are the result of many factors one particular facet of software development upon which all developers have an in uence is coding technique The easiest method to ensure that a team of developers will yield quality code is to establish a coding standard which is then enforced at routine code reviews Although the primary purpose for conducting code reviews throughout the development life cycle is to identify defects in the code the reviews can also be used to enforce coding standards in a uniform manner A comprehensive coding standard encompasses all aspects of code construction and while developers should exercise prudence in its implementation it should be closely followed Completed source code should re ect a harmonized style as if a single developer wrote the code in one session Reasons for a standardize code style of the lifetime cost of a piece of software goes to maintenance Hardly any software is maintained for its whole life by the original author Code conventions improve the readability of the software allowing engineers to understand new code more quickly and thoroughly Your source code is a product you need to make sure it is as well-packaged and clean - - CC Code Style Guide Style Guide - - CC Code Style Guide Source File Organization One Class per File Source ?les should contain one class de ?nition per source ?le Said di ?erently each ?
Documents similaires










-
309
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Aucune attribution requise- Détails
- Publié le Mai 18, 2022
- Catégorie Law / Droit
- Langue French
- Taille du fichier 122.3kB