Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

Decrease code fragmentation, make constants follow naming convention#3

Open
willgames-afk wants to merge 1 commit intoWilsonville_FunctionBasedfrom
Refactor-Constants.kt-into-Safety.kt
Open

Decrease code fragmentation, make constants follow naming convention#3
willgames-afk wants to merge 1 commit intoWilsonville_FunctionBasedfrom
Refactor-Constants.kt-into-Safety.kt

Conversation

@willgames-afk
Copy link
Contributor

This PR factors out most of the code in Constants.kt into other files.
But why?
Many of the constants defined in Constants.kt were only use one time, in another file. It didn't make a lot of sense to me to separate it into a constants file at that point. Like, we had a mini version of each of the subsystems in the constants file- why not just put those constants into that subsystem?

Having them in separate files means that there are now 2 places you have to change whenever you update a file, making the rapid iteration present in FRC result in very messy code, and slowing down the process. I personally find it very helpful to see where my values are being used, and storing them all in a separate file means that I don't have that context.

I decided to keep constants.kt around, but change its purpose from storing all the constants of the program to storing constants related to safety (ie current limits, max speeds, etc)

I'd like your feedback on this- did I go too far? Should we keep CAN constants in one place for fast access? Please collaborate with me on this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant