D4.15 – Style & Naming Conventions in Code

Two main reasons for good style

  • Enables someone else to read and understand your code more easily and successfully
  • Enables you or anyone else to make changes and improvements later

When working on code, especially in a team it is very important to code in a certain way, to follow coding conventions. These are things like starting class names with a capital letter and objects with a little letter, using meaningful names for the fields and variables you are using, indenting the code, inline annotation etc.

The main point is that code is read more often than it is written. If everyone codes in the same way it becomes more easily read. This cuts down time on maintenance and reduces the chance of error through misinterpretation. This in turn saves time, money and effort.

This point is even more important when working remotely i.e. away from your colleagues. You might be working across the country or across the world. If everyone follows the conventions, code is easy to read and update.