So in using the Blinks library, I’ve run across a little grammatical annoyance. Right now when you send a value on a specific face, you use setValueSentOnFace(value, face). This makes sense because in the wording of the function, value comes first and face comes second. It also has to be this way because setFaceValue is slightly ambiguous, since values are both sent and received.
For color, it’s opposite. The function is setFaceColor(face, color), which, while internally consistent, is backwards from how values are sent. I’m proposing that we change this function to setColorOnFace(color, face) so that the two functions are parallel, which I think will lead to fewer accidents and a sense of consistency.
All that aside, I was very quickly able to make setColorOnFace a function in the library by adding it to both blinklib.h and blinklib.cpp. I literally just copied the code for the old function and added a new one beneath it with identical functionality, and it worked just fine on my blink.
Now that I’ve done that, I’d like to know if there was a way to send a deprecation warning when a developer uses the “old” version of setFaceColor. Something like “You are using setFaceColor(face, color), which is being deprecated. Please use setColorOnFace(color, face) in its place.”
Does anyone know how to add warnings to the codebase?