allwpilib icon indicating copy to clipboard operation
allwpilib copied to clipboard

[command based] use C++ operator overloading to improve syntax for a variety of command functions

Open spacey-sooty opened this issue 7 months ago • 4 comments

Resolves #6075

spacey-sooty avatar Jan 04 '24 08:01 spacey-sooty

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.

Starlight220 avatar Jan 04 '24 08:01 Starlight220

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.

spacey-sooty avatar Jan 04 '24 08:01 spacey-sooty

Operators are shorter, but it's unclear at a glance what they mean. I agree that this is an example of operator overloading abuse.

calcmogul avatar Jan 04 '24 09:01 calcmogul

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?

ncorrea210 avatar Jan 04 '24 13:01 ncorrea210