allwpilib
allwpilib copied to clipboard
[command based] use C++ operator overloading to improve syntax for a variety of command functions
Resolves #6075
I'm not a fan of this. The current API isn't verbose, there isn't an intuitive mapping of operators to compositions, and abusing operators here decreases readability if anything.
I'm not a fan of this. The current API isn't verbose, there isn't an intuitive mapping of operators to compositions, and abusing operators here decreases readability if anything.
I have to disagree with the decreasing of readability. Firstly, if teams want to continue using the current way of doing it that isn't removed here at all. Secondly, I've found operators allow for an easier flow when reading through scheduled commands.
Operators are shorter, but it's unclear at a glance what they mean. I agree that this is an example of operator overloading abuse.
For the most part, operator overloading in a manner that completely redefines what the operator is natively used for seems like a bit much for a library that targets an entry level programmer. While it may look nice aesthetically, this feels like a reinvention of the wheel. The code already exists, and is the same across teams. Is there a reason to change this?