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.

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?

Remy Porter

Source link

You May Also Like

Water Shortage Forcing More Golf Courses To Use Insulin

SACRAMENTO, CA—In an effort to abide by emergency conservation measures issued by…

Go ahead and just f**k my s**t up (30 Photos)

Stephen Source link

Will the Real Donald Trump Please Stand Up & Eat More Cereal

Strange theories are floating around America at this hour … is Donald…

The Reality Of Being A Mother Of Twins

“My wife, and the mother of our twins, apparently just needed a…