Skip to content

Don't force public variables to use Hungarian notation#8774

Open
Gold856 wants to merge 4 commits intowpilibsuite:2027from
Gold856:dont-enforce-prefix
Open

Don't force public variables to use Hungarian notation#8774
Gold856 wants to merge 4 commits intowpilibsuite:2027from
Gold856:dont-enforce-prefix

Conversation

@Gold856
Copy link
Copy Markdown
Member

@Gold856 Gold856 commented Apr 16, 2026

People generally have expressed a dislike for the Hungarian notation used in member variables, especially in examples/templates. There are some benefits to Hungarian for private member variables (like knowing what's a member vs. local in a PR review) so we'll keep private member variables the same for now, but public variables and any variables accessed like struct fields should no longer use Hungarian notation, since it looks much worse. New PMD XPath rules have been added to accomplish this goal. Additionally, this also enables the PublicMemberInNonPublicType lint, as there's a lot of nested classes (especially in DriverStation) that have fields which are directly accessed, and those should not use Hungarian either, so this lint forces the fields to be "package private", which then will cause the new rules to apply.

This also removes all Hungarian notation from the examples/templates to not force downstream users to use the same style as us and because people disliked it.

@Gold856 Gold856 requested review from a team and PeterJohnson as code owners April 16, 2026 21:50
@github-actions github-actions Bot added component: ntcore NetworkTables library component: cscore CameraServer library component: wpiutil Utility library component: wpilibj WPILib Java component: wpilibc WPILib C++ component: hal Hardware Abstraction Layer component: wpimath Math library component: apriltag AprilTag library component: examples component: wpiunits Java units library component: epilogue Annotation-based logging library 2027 2027 target labels Apr 16, 2026
@Gold856 Gold856 force-pushed the dont-enforce-prefix branch 9 times, most recently from 8345c2e to 4efa3c3 Compare April 17, 2026 20:12
@Gold856 Gold856 force-pushed the dont-enforce-prefix branch from 4efa3c3 to 557de6c Compare April 21, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2027 2027 target component: apriltag AprilTag library component: cscore CameraServer library component: epilogue Annotation-based logging library component: examples component: hal Hardware Abstraction Layer component: ntcore NetworkTables library component: wpilibc WPILib C++ component: wpilibj WPILib Java component: wpimath Math library component: wpiunits Java units library component: wpiutil Utility library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants