A reminder that "For sale: baby shoes, never worn" isn't the shortest horror story ever written, it's actually "Specifies a tri-state Boolean value" written by the esteemed author Microsoft .NET Documentation.

Context: https://learn.microsoft.com/en-us/dotnet/api/microsoft.office.core.msotristate

Note that there are actually 5 values, not three. Also True is -1, and the value that equals 1 isn't supported.

MsoTriState Enum (Microsoft.Office.Core)

Specifies a tri-state Boolean value.

@mdiluz I suspect that -1 == TRUE dates from the old VARIANT_BOOL type way back in OLE, which has the same encoding. Old APIs leave a long shadow!
@kbm0 @mdiluz
It's much older, true was -1 all the way back in 8 bit BASIC (e.g. Commodore 64).
@leeloo @mdiluz It makes sense because then logical NOT is then the same as inverting all the bits in the word. The safe convention used in C is usually to stick to testing for (value) or (!value), ie. (value != false) or (value == false). Never check for (value == true). Having a tristate value really complicates things.
@kbm0 @mdiluz
Just as you can AND -1 with any non-zero value without getting 0/false.

@leeloo BASIC simply didn't distinguish between logical and bitwise operators; as a side effect, there is no short-circuiting of logical expressions

Visual Basic 5 was one of my starter languages and in retrospect, I understand why Dijkstra hated BASIC so much that he considered programming students with previous exposure to the language damaged beyond healing: it teaches you all sorts of wrong lessons on what's possible in programming and how to achieve it. The one serious Visual Basic book, Hardcore Visual Basic, was mostly about how to implement bog standard computer science concepts in a language that was completely hostile to... programming. If I remember correctly, among other things it explained the concept of short-circuiting logical expressions, and how to implement them manually

@leeloo I guess that the punchline is that the choice to adopt BASIC as the Office scripting language resulted in trace amounts of BASIC surviving all the way to the most recent versions of .NET