DEV Community

Discussion on: Do you think the differences between HTML and XHTML are generally well-understood?

Collapse
 
moopet profile image
Ben Sinclair

I didn't know anyone still used XHTML to be honest. I thought it was a grand experiment that was killed off by people not caring about how it was used and writing pages which broke in Internet Explorer, because Internet Explorer was actually doing The Right Thing.

Mind you, I don't do much front end stuff these days, and React is something that's always on my "to learn someday" pile.

Collapse
 
ben profile image
Ben Halpern

React's JSX is XHTML-like. It's neither HTML or XHTML or JavaScript. It's its own thing, but I think people can get tripped up when their React linter tells them that <div></div> should be <div /> but then they don't fully understand that self-closing tags are not a thing in HTML otherwise. And it's a mistake that won't throw an error but could cause a big mess down the line.

Collapse
 
asaaki profile image
Christoph Grabo

I wish self-closing tags were a thing in HTML(5), because <div></div> and friends are sometimes unnecessarily noisier than <div />. Probably the only feature of XML I like anyway.
I still write a lot of my <meta />s that way, even if not needed, but I run it through tidy, so it makes the HTML the way browsers mostly expect it to be. :shrug: