Tuesday, June 16, 2020

toddlerBoolean: a promising new data type for the obfuscated coding community

It all starts with the following

parent: are you done?

toddler: no I'm done.

This reminds me of the occasional adult failure to use the nuance of mind:

X: do you mind if I change the channel?

Y: sure! go ahead

Programmers -- specifically those who work with Java -- may likely have encountered helpless code where a boolean field or the result of a method returning a boolean value is compared using == (or worse !=) to false or true.

The time has come to offer a balm of sorts for those wounds. There's nothing like granting formal recognition to a mistake abd paving the way for it to become standard practice in a more palatable form.

I give you the toddlerBoolean. Assertion through negation with a cherubic twist.

No comments:

 
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.