Second, imagine an editor that has AI running in the background, scanning your files. "Enable_AI" could just mean enable the visibility of the feature to actually use the results. On the other hand, it would sound more suspicious if there were some background AI tasks running, even for training purposes, if "disable_AI" were "True" as compared to "Enable_AI" to be false.
In other words, Enable_AI COULD have the connotation (to some) of just enabling the visibility of the feature, whereas Disable_AI gives more of a sense of shutting it off.
Imagine for example you're in a court of law. Which one sounds more damning?
======= Prosecutor: You still have AI tasks running in the background but AI_Enable is set to false?
Defendent: But Enable_AI just means enabling the use of the output! ====
==== Prosecutor: You still have AI tasks running in the background, but AI_Disable is TRUE?
Defendent: Uh.... ====
> ==== Prosecutor: You still have AI tasks running in the background, but AI_Disable is TRUE?
Defendent: But Disable_AI just means disabling the use of the output
Personally, I don't feel much difference between the two. I doubt that an average reasonable person would either.
Because double negatives are confusing. Enable_AI = true is much clearer than Disable_AI = false.
Defendent: But Disable_AI just means disabling the use of the output! ====
==== Prosecutor: You still have AI tasks running in the background, but AI_Enable is FALSE?
Defendent: Uh.... ====
...it cuts both ways, sorry.
If it was just CGO=true or CGO=false I think so much confusion could have been avoided.
I think similar thinking applies here. It's convoluted to disable something by setting ai_disable=true because I read it like: setting false true instead of just setting boolean.
This is not unique to Go.
I don't think me writing an if condition
if boolean != true
instead of
if boolean == false
should pass code review. I don't think my pet peeve is necessarily different from that. I understand there's a historical convention but I don't think there's any real reason for having to stick to it.
Hell, some of the other compiler options are flags with no 0 or 1, why could this not have been --static or any flag? I'm genuinely curious.
Moreover, 0 here maps to false but in program exit codes it maps to success which in my mind maps to true but then we have this discrepancy so it does not appear to be the right mental model.
That's crazy. Boolean logic is the most fundamental notion of computer science, I can still remember learning that in my very first course on my very first year.