Re:Developers are your users too – a defence of 'View Source'
by JMTQp8lwXL on Saturday June 13, 2020 @05:08PM
(#23512748)
Class names should not be semantically relevant. Typically, class names aren't announced by screen reader technology. In this particular case, I think better developer tooling is the solution. An option to hide the class attribute would dramatically simplify that DOM view. It's also possible those class names could be mapped to some pre-minified, human-readable values.
[ Parent
| on HN ]
Re:Developers are your users too – a defence of 'View Source'
by MereInterest on Saturday June 13, 2020 @10:15PM
(#23514573)
As somebody who has only dabbled in web programming, I thought the entire purpose of having CSS class names was to have them be semantically relevant. That way, your HTML could read class="appendix-reference" instead of class="light-blue-4 green-background-2 underline apply-hovertext".
Re:Developers are your users too – a defence of 'View Source'
by yunruse on Saturday June 13, 2020 @06:22PM
(#23513332)
That’s true, but well-named semantic classes aid with other accessibility purposes. Making elements easy to target means screen scrapers and user themes can be maximally effective in targeting the right elements.
Some user themes are for visual nicety, sure, but they might be essential aids to some. Making it easier to data-grab with BeautifulSoup etc means any data shown is more portable, too. Data scraping is all sorts of useful, and having classes that aren’t minified garble makes it a considerable amount easier to target.
Re:Developers are your users too – a defence of 'View Source'
by JMTQp8lwXL on Saturday June 13, 2020 @06:51PM
(#23513523)
Even with the best of intentions, DOM structures can change without advanced notice. Instead of scraping via DOM structure, why not screenshot a webpage and use OCR? I think the solution to the scraping problem is being viewed narrowly.
Re:Developers are your users too – a defence of 'View Source'
by taeric on Saturday June 13, 2020 @08:09PM
(#23513974)
This suggestion is a hilarious admission that hypertext as conceived failed. And that makes me rather sad.
Re:Developers are your users too – a defence of 'View Source'
by JMTQp8lwXL on Sunday June 14, 2020 @08:15AM
(#23517125)
It didn't fail. People don't want others scraping to protect their businesses. And that's how we've ended up with highly obfuscated HTML. If it failed, it wouldn't work at all. HTML was designed to display documents, not for scraping purposes. You know what is designed to be scraped? An actual application programming interface.
Re:Developers are your users too – a defence of 'View Source'
by dndvr on Saturday June 13, 2020 @05:47PM
(#23513060)
So source maps for html?
Re:Developers are your users too – a defence of 'View Source'
by JMTQp8lwXL on Saturday June 13, 2020 @06:49PM
(#23513511)
CSS files already have source maps, which give you the map between the original and compiled class name.
You need better developer tooling that would show the pre-compiled class name when viewing the DOM. Feeds into the "better developer tooling" concept.