When introducing customized coding guidelines, shoud you rather use established, publicly available rule sets (e.g., Misra C/C++, AutoSAR C++, CERT, …) than invent “your own” rules?
The standard rule sets as such are well written and are free from flaws in phrasing. Therefore, they are an excellent starting point for creating your own rules. Nevertheless these rule sets are very generic by nature and they cannot cover specific conventions and rules for companies, projects, or application domains (such as naming conventions, rules for project structure). Rules for technical specialities are not covered, too. The missing aspects have to be complemented by yourself.
On the other hand, the standards usually come with mechanisms for deactivating individual rules in a way so that you can still be “compliant” with respect to the standard.
Bottom line: it is not recommended to invent new rules for switch-case-constructs (that’s already covered); own rules for the individual needs are necessary for taking into account your environment and increase acceptance.
[by Dr. Daniel Simon, Head of Professional Services, Axivion GmbH]
If you would like to find out more about Axivion or our Axivion Suite please follow the links or contact us directly via Chat, contactform or by Email. We are looking forward helping you.