Why windows is backwards
Many times people ask me, "Adam, why don't you like windows?". I will usually say "It's built wrong, it's locked down, they didn't think it out well, the calls make no sense"... This kind of thing doesn't make sense to most people. I've never been able to give concrete evidence to "normal folks"... until now.
In this example of "Why I hate windows", you can the "Win32 BOOL type" is 4 bytes. a false is 0 and anything else is true. A Boolean is a true/false.. Or Binary. it's a one or a zero, a on or an off, a yes or a no... The basic way your computer runs is by analyzing Boolean values and comparing them.
Ok, so lets break down what that means.. we have 8 bits (ons and offs) in a byte, so we have 4*8 or 32 total bits. A single bit represents a true or false. Why are 31 bits of metadata required for this operation?
4 bytes.. This is enough to print just about any typical unicode character. It's enough to print four UTF-8 charactes. A single byte of UTF-8 is capable of carrying 8 Boolean or binary values.
If all of those bits are turned off, we have a false, if any of them are turned on we have a true. So windows can be "true" in 2^32-1, or 4,294,967,295 total ways, and false in just one. Kinda arrogant huh?
Generally with programs you have something called an Exit Status. If the Exit Status is 0, the program ran properly. So for error codes this means Yes, It is True this program didn't run right. In order to analyze this properly, you take the exit code, turn it into a Boolean and invert it. It's an extra step.
Don't even get me started on serial ports or Windows API. I could rant all day... Now I know what you're thinking.. "Adam, tell us how you really feel".... Ok, Windows, GO KILL YOURSELF!