Writing Good Code

  • Avoid if trees

  • Well-named variables and functions

  • Separate things on to multiple lines, avoid long lines

  • Avoid excessive use of options

  • Add comments around sections that are dense or confusing

    • there is such a thing as too many comments, but no comments is generally worse

  • Use filters, use guarded events (specific ones), avoid contains

  • Avoid using offline players as much as possible

  • Use white space

  • Separate things into useful functions

Last updated