Concepts

Guidelines

Functions

  • Classes should be small. Conform to SRP
  • Functions should be small. The indent level of a function should not be greater than two
  • Classes should be Cohesive. Have a small number of field
  • Descriptive names
  • One level of abstraction per function
  • Functions should either do something or answer something, but not both
  • Function arguments should be kept to a minimum

Naming

  • Use intentionally revealing names
  • Use pronounceable names
  • Use searchable names you can use in discussions
  • Make meaningful distinctions between variable names
  • Classes should have Noun or Noun Phrase names
  • Methods should have Verb or Verb Phrase names
  • Pick one word per concept (dont use fetch, retrieve, get all at once)

Comments

  • Use comments not to explain code, but to provide:
    • Legal comments
    • Explanation of intent
    • Warning of consequences
    • To-Do comments

Tests