-
Notifications
You must be signed in to change notification settings - Fork 0
Naming Conventions
Classes in the codebase use UpperCamelCase or PascalCase.
class HelloWorld {}
Each type of class has a different word structure:
For subsystems, names should be concise and have a max of 3 words, like VisionSub
, ArmSub
, ClawSub
, etc.
All subsystems need "Sub" appended at the end of the concise class name.
Command class names should be long and descriptive to allow for ultimate readability. Long names are preferred due to the lack of new declarations or use in non RobotContainer
files. All commands need "Cmd" appended at the end of the name.
Utility class names should be concise and have a max of 2 words. All utility classes need "Util" appended at the end of the name.
Methods need to be as short as possible, but not too short that it becomes hard to understand their purpose. Shortening words like "arbitrary" -> "arb" should not be done, but shortening words with common abbreviations like "Feed Forward" -> "FF" is fine.
Motor names need to describe the purpose of the motor and should ideally be under 3 words. Motors should have a shortened class name prefixed to them and "Motor" as a suffix. If a group of motors is being run synchronously, the main motor should be suffixed with "A" and the next motors should follow the alphabet. A couple of examples are ArmCascadeMotor
, ArmJointMotorA
, ArmJointMotorB
, etc.
Button variable names need to be as short as possible, but not too short that it becomes hard to understand their purpose. Shortening words like "arbitrary" -> "arb" should not be done, but shortening words with common abbreviations like "Feed Forward" -> "FF" is fine.