Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Constant Handling #4

Open
adnewhouse opened this issue Oct 26, 2017 · 0 comments
Open

Better Constant Handling #4

adnewhouse opened this issue Oct 26, 2017 · 0 comments

Comments

@adnewhouse
Copy link
Contributor

I recommend using predefined constants for any magic numbers anywhere in the code. For example in robotmap.java:

leftDrive = new CANTalon(1);

should read something like:

leftDrive = new CANTalon(kLeftDriveMasterId);

Storing the constants in constants.java is probably OK, but an even better solution is a text file that is read on robot code startup so that changing a constant does not require recompiling and redeploying code. For Ruckus, what you have is fine, but on the competition bot it is pretty much required to handle constants gracefully.

Here is a clunky java implementation I found that does this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant