by senbrow · 1y ago · 0 comments
Why would you name an option "disable_ai" with a default value of false instead of calling it "enable_ai" with a default value of true?
Are there some mechanical semantics I'm missing here that make this beneficial?
Negative booleans (ie that remove or suppress something when true) are generally a source of confusion and bugs and should be avoided like the plague in my experience.
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.... ====
Personally, I don't feel much difference between the two. I doubt that an average reasonable person would either.
> ==== 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
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.
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.
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.
They had AI features that were always on.
Some people complained so they introduced a flag to, wait for it, disable the ai features.
So they didn't think too deeply about it and named the flag "disable_ai" because it mapped into how they were thinking about it.
You overstate the problem with negative booleans. It's trivial for them to add a function:
fn isAiEnabled() { return !disable_ai }
and just use that.if(disable_ai) { //disable shit }
I think it's reasonable to, for example, have a field that is labeled "Do Not Track".
From a business perspective, investors want to hear that AI is indeed part of the shipped product.
It's all about optics.
"disable_user_tracking: false" vs "enable_user_tracking: true"
"disable_adverts: false" vs "enable_adverts: true"
Fewer people would actively _enable_ user tracking or adverts compared to those who would take extra steps to _disable_ them.
I spent 20 years without it. That's enough for one lifetime.
I completely hated it when I tried it out. It breaks my flow. Those weird pauses are so painful. Feels like someone grabbing the steering wheel while I am driving.
I heavily use the agent mode but I don't understand the appeal of the autocomplete feature but maybe I am missing something.
It is fascinating to me how much of the enthusiasm around AI seems to be the result of people not knowing about/using the deterministic tools that already exist.
AI autocomplete can generate the entire `match` tree for a very complex Rust enum, and also generate all of the associated tests. It then takes me to the next places in the code where changes need to be made. It's wildly good at knowing exactly what I want to do next.
2002 macros and autocomplete were not that and cannot possibly be compared in the same light.