There is a precedent here, a programmatic answer to one of my questions that guided me to flag this answer as NAA ( flag history reveals this as disputed)
Simply put, the point here is usefulness of answer Vs Site Guidelines. Making exceptions based on utility of answer invites setting up a precedent.
Hypothetically, if one knew a better way to code and post alternative answer highlighting that, what should one do? Or, if the OP/ another visitor who also knows coding seeks a clarification? (Agreed, I am stretching possibilities)
IMO, it would be more prudent to adhere to site guidelines and I fully support Firelord's view. He has pointed out successful moderator intervention in past, for deletion of such answers
There can and should be a discussion on border line cases but not in cases like this where it is clear cut (= it does not belong here)
Edit: Another possible instance where non adherence to site guidelines wouldn't help. There are accepted ( commercially implemented ) solutions pertaining to charging, which are in the nature of shorting some pins or connecting a resistor across some pins to achieve results
These work, are useful but do they belong here ? (on this site, as an answer)