koibots8230 / RumbleBot2024

MIT License
0 stars 0 forks source link

private final member variables #1

Closed eskiles closed 2 months ago

eskiles commented 2 months ago

@ConradSkelly Use the keyword final for member variables that are created once during construction and never change through the life of the object. E.g. as long as the Shooter subsystem exists while the robot is running, it will have exactly one topMotor.

private final CANSparkMax topMotor;

The variable isReal should also be private and final since the robot doesn't change from simulated to real and back.

https://github.com/koibots8230/RumbleBot2024/blob/eef158144149c2a53edf250ccf615ac48a637772/RumbleBot2024/src/main/java/frc/robot/subsystems/Shooter.java#L24