-
Notifications
You must be signed in to change notification settings - Fork 0
Style Guide
This is a style guide that all files in this repository should follow
1. Use generalized method names. Global method names for something that does something physical on the robot:
(What part it affects)(Where that part is/subpart if applicable)(What it is doing to that part/how it is changing it)(What input it needs)
For example, if we had a subsystem named SubSys_Arm.java we would base our method names on that. Assume inside this subsystem we had a method that raised the arm given a set amount of power -1 -> 1. We would create a method named something like this.
ArmRotatePercentOutput()
Arm is the part of the physical robot that is being affected. Then we have Rotate which is what the Arm is doing. Finally, we have PercentOutput this shows that the method needs a double value inputted or a percent.
2. Avoid nesting and unstyled code Code should not be nested more than three layers deep as it becomes extremely confusing for other developers to understand. A good general rule of thumb is to create a function for what would otherwise be nested code if you need that level of function. The code should also be styled generally. Deepsource should automatically fix your styling but please be sure to try to keep the code as neat as possible.