DEV Community

loading...

Should we be Correct?

adam_cyclones profile image Adam Crockett ・2 min read

Let's talk about a framework which made me question my core beliefs.

I want to love Riot.js but I have learned to follow correctness and smite those who have deviated from the holy will of specifications. Of course that last bit is totally true. 🤣 2% true.

I see Riots beautiful Vue like syntax and then I realize it spits out invalid html ‼️, to Riot.js this is a web component vs the wc3 specification, how am I supposed to feel about that?!

A framework that makes me question my values.. super, so let's get into it.

Questions Stack Up

Years back I recall my first stack overflow question which was something like this "why can't I use deprecated or invalid html?"
You can imagine what the response was, far from constructive.

What I wanted was an answer such as "the browser will ignore your element entirely and report your webpage to the internet police"

I never got that answer, but years later I found out that the reason, the single and only reason that matters to me, accessibility, elements all have symantec meaning to help assistive technology. If you have limited sight then you can have a screen reader help you understand what is infront of you. An invalid element does not. Although not quite as important but still highlighting how browsers like known elements, a user agent stylesheet exists to define default styling... Just so we can undo it.

Now, that means that <fish> element has no apparent use and no meaning whatsoever, it is undefined behavior. A div and span are defined to have no meaning which is somehow the same difference if you see my point, atleast that's my theory.

Should I feel guilty for using Riot.js ... Well I think that's putting me off starting a project 😭.

The web component

The specification for web components has some really anoying parts and some great powers too but it's a specification none the less, Riot says no, no to hyphans which I actually agree with, it doesn't register the element with the browser... What does that mean though? why did I always register my elements?

So this library is very controversial for me. Clearly some specifications are not created equal, so does that mean we have to live with them?

What do you think, should I chill out maybe not care and do what I like not what I am told is right, is that correctness, can a developers personal correctness actually be correct without consensus?

Discussion

pic
Editor guide