Precisely Identify Boundary Conditions [VA3]

Precisely Identify Boundary Conditions [VA3]

Tip VA3

Related to double-checking variable name accuracy, exercise care in naming when boundary conditions are involved. Boundary conditions can be ripe for errors, so precise identification is valuable.

See the example below:

A program might need to do different things depending on if a user is exactly the retirement age, is older than the specific retirement age, or has reached the retirement age at all. You want the resulting logic to be correct - and for readers to correctly understand the logic - so make sure such boundary conditions are precisely identified in your variable names.

 

Code in the zone ad.png