I think one of the things we don't appreciate enough about Rust is how it goes out of its way to say "hey! looks like you're trying to use a C idiom. Here's how we say that in our language." Anyway we spell `-1` as `!0`, which is something we may want to tell C programmers.
I will always think "ok so it's 1" and then stare and be confused when I see `!0`
-
-
yeah this is a very real cost of a language tradition that doesn't have booleans, and/or failed to represent them as `0` and `~0` :/
-
I guess my point is that more generally "all bits set" is not something that represents what you actually mean, even when working at a low level. Even if more often than not, it's actually just a sentinel value, max or all bits is irrelevant, MAX is harder to misunderstand
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.