Skip to content

Best Practices

Nolan Barker edited this page May 1, 2024 · 1 revision

Best Practices

  • Return Conditionals directly without if statements
  • Use ternary operators (question mark) sparingly
  • Keep code clean
  • Add comments through out code frequently
  • Keep the names of the Constants and Methods consistent
  • Use descriptive Variable and Constant and Method names
  • Highlight Units of Measure
  • Use LOGGER instead of Sysout
  • Single purpose methods
  • Evaluate existing solutions
  • Read the fine Manual
  • Make multiple debug widgets
  • Be careful, avoid collisions or missing addRequirements() in commands
  • Always use Constants when applicable
  • Use github, and commit frequently
  • Paired programming
  • Test in simulation
  • Tune and LOG PID early
  • Have a better Dashboard (Display setpoint & accept PID input)
  • Leave Logging statements in, never delete them
  • At Competition keep logger level to WARN
  • Limit CAN traffic to necessary (fix to CAN latency)
  • Find the root cause and don't cover it with bandage Code
  • Test Code to break it
  • Run automated tests
  • Use LEDs to send status messages
  • Automate more drive team functions (endgame, Intake, Score)
  • Consider different subsystem refresh frequencies

Clone this wiki locally