Following the following instructions will save you a lot of time and will speaks well about your reading comprehension. Make sure to take note and to comply.
Unless the language forces you to do otherwise, the source code must comply with the following:
Be in English (even the comments).
Indent using 2 spaces instead of tabs, unless the language requires otherwise.
Lines must not exceed 80 characters in length.
Lines must not contain debug comments left behind.
Function definition must be separated by 1 empty line, unless the linter or the language requires otherwise.
Unless the linter or the language requires otherwise, please always include one space around each side of most binary and ternary operators, such as any of these:
= + - < > * / % | & ^ <= >= == != ? :
Avoid using var names like x, y, z, i. Instead of that use more useful names, i.e., if x is a constant you can use const_x or something that you prefer
Some languages such as Haskell, OCaml and others have quite a different syntax than other more common languages such as python. So you should find and follow the style guides for these types of languages, however, if possible you must keep the rules set out above.
Embedded code snippets must comply with the following:
- Be enumerated. To do so add the parameter linenums to the source block.
- Do not have more than 8 lines.
- Do not repeat a snippet that has already been used in the guide.
- Add the lines of code to the post using a code block, don’t use images.