If you're just going to sit there doing nothing, at least do nothing correctly
5 points by ucirello
5 points by ucirello
The idea here is to have the printing functions all behave in a manner perfectly consistent with printing being fully supported, yet mysteriously there is never a printer to print to.
This explains so much…
Joking aside I don‘t agree with this article. I don‘t like this overly defensive programming & UX. With this you get software that for ever reason doesn‘t do what it is supposed to do with literally no way of finding out why. Instead apps should catch the error, if applicable & possible create a user friendly error message and else just display the plain error message to the user. If it is a background task have an error log.
I acknowledge that this post is written from the view of the API developer not the app developer. So document your API errors and provide actionable error messages from your side.
On another note, I also don‘t like the UI hiding buttons, because you don‘t have access to them. If UI space allows for it show the button, deactivate it and provide an actionable message when the user is hovering the button on how to activate it.
On the other hand, nowadays, can we trust the apps anymore, at least if this is an OS API? Maybe we should always tell the app it has all the permissions and just give it user-configurable confetti instead of data/ability to change data. Might simplify graceful degradation on security updates to API.
I have been doing a lot of AI-backed programming (aka vibe coding aka agentic programming), and I often saw the agent doing if-checks for nullity; whenever I see one of those, I remind myself of this piece. I just prompted the agent to use inert functions instead of testing for nullity, and checking one, at declaration, that the value is never null.