3 ms·
I don't know if it's the way my brain works, or just an aesthetic thing, but I am completely allergic to programming with strings. Totally get the reasoning beh
by mpalmer 2y ago
I don't know if it's the way my brain works, or just an aesthetic thing, but I am completely allergic to programming with strings. Totally get the reasoning behind this, especially the accessibility wins, but I'm not particularly excited about using element IDs for yet another layer of web app behavior.
- hdjrudni 2y agoI don't like it either, but at least we can pave over it with a framework, unless you're allergic to those. It makes a good building block.
- mpalmer 2y agoTrue, and don't get me wrong, I think events are great and this will be a decent simplification, even with existing frameworks. If it's Turing-complete, non-opinionated and doesn't use templates, I can put away the Epipen.
- conartist6 2y agoI know what you mean
- qwery 2y agoStringy code is my go-to example of a code smell. You can do it, it works and yes, as long as you write it correctly it will work correctly, but you're just kicking the can down the road, at best. HTML elements are naturally stringy and that makes sense -- when the HTML describes a document. But in the context of complex applications it leaves a lot to be desired. It's a hack. This isn't to say the feature being discussed is a bad thing. It's obviously a hack. On such an established platform, there's suprisingly little room between 'throw it all out' and 'just one more patch'.
- ximm 2y agoI agree, but at least it is consistent. This is also how `for`, `list`, `aria-labelledby`, `aria-describedby`, and probably many other attributes work.