Introduction

Coding standards are one of the most controversial topics among the development teams. It is natural, that everyone, regardless of skill, have their own opinion on the subject. This leads to unnecessary tensions between cooperating developers. However poorly written coding standards, or no standard at all, usually leads to code that is difficult to grasp and thus makes debugging someone else's code a difficult job. Job which can ultimately make a piece of code impossible to modify and/or expand.

A successful coding standard is one which addresses these issues by, ideally, not allowing them to arise. If such problem arise a solid coding standard allows them to be easily remedied.

TE Coding Standard aims for:

  • common look and feel of the complete code base of the game
    Rationale: common feel reduced the cost of introducing new developer to a given piece of code, as the person only needs to adjust once to how code is written. For each subsequent code piece he/she just needs to adjust to what a given piece of code does.
    Rationale: the half life of knowledge what a piece of code does, and how it does it is short even for the person who wrote the code.

  • ease of maintenance of the code via expanding / debugging / local changes
    Rationale: changes made to a file will be seamless to its surrounding, this does not introduce informational noise to the source file. Detailed history of changes can always be extracted from version repository.

  • Enforcing of certain good coding practices and setting a common level of understanding of them.
    Rationale: reduction of amount of bugs arising from miscommunication of intent of the coder – such as passing an argument to a function

  • Setting common understanding of practices in a code.

TE Coding Standard does not claim:

  • code written in it shall be error free – code written with TE coding standard may be less error prone, but does not guarantee correctness

  • code written in it will have best performance

  • code written in it will be optimal for each set of constraints placed upon the design

TE coding standard aims for setting common understanding of the code base, clarity of documenting the intent of the code and streamlining the development process. Lower incidence of common bugs may be a result of the presented practices, but is not the most important goal.