Skip to content

Conventions

We spend much, much more time reading code than writing code. Conventions are there to improve software readability and allow developers to understand code faster and better.

Breaking with convention is allowed if it’s intentional. You must have a good reason to do so.

  • Names must clearly describe the object
  • Use PascalCase for all names
  • Don’t use Hungarian notation (like intNumber)
  • Don’t use abbreviations except if they are well-known
Applies ToConventionExample
Service[Noun]ServiceTimerService
Type[Noun]Car
Type property[Noun]Brand
Boolean type propertyIs/Has[State]IsFast
Function[Verb][Noun]GetCar
Function parameter[Noun]Colour
Setting[Noun]Key
Variable[Noun]Car

Name the IfElse function If[Description] and the conditions [Verb][Noun], where the Verb reflects the boolean nature of the condition – words like Is, IsNot, Has, and Contains. Examples are

  • Function: IfWeather, Conditions: IsCold, IsWarm, IsRainy, IsDryAndWindy
  • Function: IfText. Conditions: ContainsLetters, ContainsNumbers, HasLessThanThreeCharacters