Hacker News new | past | comments | ask | show | jobs | submit login

Maintainability and browser compatibility (less of an issue these days). If you use a non-standard attribute and hand your code off to someone else, they likely won't catch it and can introduce bugs.



Regarding the bugs, what makes it more of a problem in HTML attributes than with any other code?


Nothing makes it more of a problem. Same as any other code. Just the idea of introducing non-standard things (especially if used inconsistently) increases the likelihood that things will break and be harder to fix.

For example, if someone binds an event listener to an element in two different places with something like clicker="button" in one place and then uses data-clickable="true" in another place, it can introduce confusion. Not only does the original developer have to remember all of their custom attributes but so does anybody else who comes on to the project.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: