SpeedControllerPair has public fields
Closed this issue · 0 comments
Seairth commented
Change the left and right fields to private scope. Generally, fields should not be public, since it is then possible to modify them without the rest of the object being aware of the change. Looking at it another way, the left and right fields are an implementation detail of the class. You should be able to change those fields (e.g. rename them, change their type, etc.) without breaking any code outside of the class.