Live data from Hacker News

Aria-label is a code smell

ericwbailey.website

11–20 of 74 posts

Re: Aria-label is a code smell

#11
post #3

This page is impossible to read on smartphone at least. There are kilometers of empty space between each line and blocks. And the font is huge. There is 20 lines of a few words each at most per page of scroll. I have now pain in my finger scrolling so much to try to see what is the point. Also a lot of useless speech and I have not reached the point of why aria label is code smell before giving up...

Have you tried using your mobile brower's reader mode?

Re: Aria-label is a code smell

#12
The article claims that aria-label is only intended to be used on interactive elements. This surprised me, so I looked into it. The ARIA spec says aria-label can used with any roles, with no mention of being reserved for interactive elements. https://www.w3.org/TR/wai-aria-1.1/#aria-label

Also, maybe I am too jaded by working at orgs that don't care about a11y, but any indication that any amount of thought has been put into a11y issues is the opposite of a code smell to me.

Re: Aria-label is a code smell

#13
post #9

A "code smell" is supposed to be something that is a warning sign that there are other probable issues and you should look deeper. Using aria-* incorrectly is an actual problem, not a hint that there may be deeper issues. It's always annoying when an article begins with a strained attempt to redefine well known terms.

It feels like you didn't read the article I read. THIS article defines "code smell" exactly as you did. And it says that using aria-* incorrectly is not a smell, but an error, exactly as you did. The claim of the article is that using aria-* at all is a code smell, in exactly the sense you said. They list a number of possible problems, and suggest alternatives. They're not saying that using area-* cannot be correct,…

"The more ARIA attributes that were present, the more detected accessibility errors could be expected"

This sounds about right for the current state of attention paid to assistive technology. Which is to say, it's an afterthought at best. Buying or installing some half-baked framework which attempts to use it correctly without even determining if it's correct or not and calling it good seems about as far as anyone will take it. One could make an analogy with left-pad: easy to use, but turns out it does the wrong thing for several cases.

Re: Aria-label is a code smell

#14
post #9

A "code smell" is supposed to be something that is a warning sign that there are other probable issues and you should look deeper. Using aria-* incorrectly is an actual problem, not a hint that there may be deeper issues. It's always annoying when an article begins with a strained attempt to redefine well known terms.

It feels like you didn't read the article I read. THIS article defines "code smell" exactly as you did. And it says that using aria-* incorrectly is not a smell, but an error, exactly as you did. The claim of the article is that using aria-* at all is a code smell, in exactly the sense you said. They list a number of possible problems, and suggest alternatives. They're not saying that using area-* cannot be correct,…

> They're not saying that using area-* cannot be correct, just that it's so often incorrect as to be a smell.

But do to accessibility correctly you almost ALWAYS need to use aria-*

So it this is just like saying "writing code is a code smell because you'll have bugs" and it turns "code smell" into a useless tautology.

Re: Aria-label is a code smell

#16
post #9

Earlier quoted context omitted.

It feels like you didn't read the article I read. THIS article defines "code smell" exactly as you did. And it says that using aria-* incorrectly is not a smell, but an error, exactly as you did. The claim of the article is that using aria-* at all is a code smell, in exactly the sense you said. They list a number of possible problems, and suggest alternatives. They're not saying that using area-* cannot be correct,…

> They're not saying that using area-* cannot be correct, just that it's so often incorrect as to be a smell. But do to accessibility correctly you almost ALWAYS need to use aria-* So it this is just like saying "writing code is a code smell because you'll have bugs" and it turns "code smell" into a useless tautology.

> But do to accessibility correctly you almost ALWAYS need to use aria-*

What? No... Screen readers do best with standard elements and you're supposed to avoid aria labels where possible, and only as a last resort.

Re: Aria-label is a code smell

#17
post #12

The article claims that aria-label is only intended to be used on interactive elements. This surprised me, so I looked into it. The ARIA spec says aria-label can used with any roles, with no mention of being reserved for interactive elements. https://www.w3.org/TR/wai-aria-1.1/#aria-label Also, maybe I am too jaded by working at orgs that don't care about a11y, but any indication that any amount of thought has been p…

Seems like it's best supported on interactive elements and doesn't lead to unintended behavior.

https://www.w3.org/TR/using-aria/#practical-support-aria-lab...

Re: Aria-label is a code smell

#18

The only thing anybody knows about accessibility is that you’re doing it wrong. Just like REST!

Yes! It’s not a good state of affairs. If you want people to build accessible websites, you can’t yell at them for not understanding complicated topics where best practices documents contradict each other. You have to lay out simple rules like “add an alt attribute to images.”

Re: Aria-label is a code smell

#19
I use aria-label on all and tags. When you look at the page hierarchy, you can tell what is what without digging into the element tree.

I don't understand how this could be a code smell.

Re: Aria-label is a code smell

#20

A "code smell" is supposed to be something that is a warning sign that there are other probable issues and you should look deeper. Using aria-* incorrectly is an actual problem, not a hint that there may be deeper issues. It's always annoying when an article begins with a strained attempt to redefine well known terms.

Using anything incorrectly is probably a problem. What makes a smell is that using it at all is worth scrutiny. Things like eval and interpolating user input can be done correctly but frequently aren't and that's why we have lint rules and names like dangerouslySetInnerHtml
Post reply on HN