Removing ableist language in code is important; it helps to create and maintain an environment that welcomes all developers of all backgrounds, while emphasizing that we as developers select the most articulate, precise, descriptive language we can rather than relying on metaphors. Quite simply, avoiding ableist language lets us make sure we are inclusive of all developers, while moving toward language that is simultaneously more acccessible to developers whose first language might not be our own.
The phrase sanity check is ableist, and unnecessarily references mental health in our code bases. It denotes that people with mental illnesses are inferior, wrong, or incorrect, and the phrase sanity continues to be used by employers and other individuals to discriminate against these people.
There are a ton of alternatives, and one of the best ways to select one is to ask yourself: What am I actually checking? and select something more descriptive. In everyday conversation, we can simply drop the idiom completely and say something akin to Let's check to ensure everything is working.
If this doesn't help, consider one of these many alternatives. I'm prone to using the first two in my own code, though these are gleaned from many developers:
- Quick check
- Initial check
- Confidence check
- Coherence check
- Soundness check
- Calibration check
- Rationality check
One to avoid? Health check. Along with again tieing in discussions of health and disability, this phrase already carries a lot of previous implications from other products that may obfuscate what you're actually trying to say.
I'm going to say I actually really dislike "coherence check." As someone who has seen the inside of a mental facility, I've heard nurses and doctors say "patient not coherent" more times in my life than I care for. I've heard it way more, as a mental health patient, than language about "sanity."
Soundness or consistency check can be pretty good as an easy substitution. I know someone people have said "consistency check" feels like something more sophisticated and shouldn't be used for quick checks that don't actually ensure data is consistent -- gut check might be good for that, as suggested above. Or, just be more specific: parameter check, bounds check or bounds check, string check, value check, etc. "Validity check" is a maybe -- I'm not sure if individuals who are not able-bodied or need an aide for common tasks still get called "invalids" or not (I used to hear it as a geriatric medical term a lot, but I'm not sure if there are negative connotations for the patients and their families.)