The coding guidelines my colleageues and I are required to follow include:
- When using ++ or -- in an expression, it must be the only operator in the expression. Rational: To avoid non-obvious side effects.
- Use the postfix form when using ++ or -- in an expression. Rational: To be consistant with i += 1
- An exception is granted is granted for do { } while (--i); Rational: This has been demonstrated to generate more efficient (faster and more compact) executable code.
There are also guidelines that specify that an assignment or assignment-like operator must be the left most operator in expressions and only one is allowed. These are also to avoid non-obvious side effects.
There are many other guidelines. When we violate a guideline we are required to document and justify the violation (unless there is an exception granted in the guidelines).
As a practical matter, my colleagues and I don't make as many violations of the guidelines as we should because of the time and effort to justify the violations. Getting more exceptions added is possible but is very difficult. The do { } while (--i); exception was among the easiest as we were able to show assembly language listings, generated by the compilers, which clearly showed the difference. Even then, it involved 5 or 6 presentations and reviews to get all the needed approvals.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.