A large part of programming is about communicating intent. The code you write needs to communicate your intent for what the code is supposed to do, both to the computer itself but also to all of the humans which come after you. So much of what we mean when we talk about code style and "clear names" is really about making your intent comprehensible to anyone else who looks at the code.

When the intent of the code isn't clear, we often rely on comments to describe that intent.

Which brings us to this comment that Noreen found.

// IsEnabled and IsDisabled are two different concepts. // IsEnabled affects whether the element can be focused. // IsDisabled affects the visual look of the element, // while allowing it to still be focusable for accessibility purposes.

In most places you encounter "enabled" and "disabled" states, they're usually- but not always- mirrors of each other. A UI element that is enabled is not disabled, and vice versa. Here we have one of those rare exceptions, where it sounds like they don't have anything to do with each other?

In this case, IsEnabled is about whether a UI element can be interacted with or not. IsDisabled changes the appearance, but not whether or not it's focusable, "for accessibility" reasons.

I don't know exactly what they mean by that. I suspect they're trying to use the word "disabled" as a proxy for "accessible", which I don't think is a great choice in how we use language. But ignoring the language police aspects, it's also just confusing. As Noreen puts it:

I know naming things is hard, but really? We couldn't do anything about this? This was the best option we could think of?

[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!