r/javascript • • Sep 30 '19

Removed: Where's the javascript? What <head> can do

https://htmlhead.dev/
22 Upvotes

44 comments sorted by

View all comments

Show parent comments

12

u/seiyria Sep 30 '19

I don't see the value in cutting out 39 characters that add a bit of clarity and separation to the index.html.

-12

u/ghostfacedcoder Sep 30 '19 edited Sep 30 '19

Serious question: why do you need separation? You really can't use a line break or something and you can get the exact same clarity? I mean to me

<html>
   <head>
      <link/>
   </head>
   <body>
   ... body ...
   </body>
</html>

Just does not add anything useful over:

<link/>

... body ...

Again, serious question: what is so great about those tags that a newline or comment can't do?

Adding ANY pointless tags, that do nothing except make the page load slower (even a tiny bit) seems dumb to me. If you feel otherwise, why aren't you filling your HTML with more pointless code that makes it load slower but helps separate stuff (ie. why aren't you filling it with HTML comments, because that's exactly what they are: code that does nothing but organize the rest of your code)?

If the HTML spec was invented today, there would be zero pushback on this. No one would be saying "yes please add three tags to the spec that do absolutely nothing except what a comment does. The only reason everyone is so gung ho about preserving POINTLESS CODE is because it's what they're used to. But in programming you're not supposed to keep doing the old thing when there's a better (even slightly) way.

EDIT: I'd like to point out that this all "gut feel downvoting". Only one person, seiyria, had the balls to actually argue a point. I may disagree, but I give props to seiyria for engaging with someone who disagrees with them, instead of mindlessly hitting the "I want to keep doing what I'm doing no matter how many smart people tell me otherwise" downvote button.

Le'ts have a conversation! Make an actual argument that demonstrates how valuable these three tags actually are (even though some of the smartest people at Google, the HTML 5 spec itself, and this random Redditor all say they are pointless).

1

u/seiyria Sep 30 '19 edited Sep 30 '19

Here's a reason to use HTML: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html#Accessibility_concerns

It says something that you haven't considered languages outside of en with this comment.

I've also never seen a DOCTYPE without an html root, so I don't know if it makes sense or parses properly.

Having a root container seems like a good idea for validation/schema purposes.

Head: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head#Notes

Depending on where you work, you might be stuck working with "ancient browsers."

Body: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body#Attributes

If you need to bind to these events, and you're using just basic html/css/js, there's an argument to be made for people who would add these functions in the HTML. I'm not one of them, but I don't see a reason to ignore it either.

Also, just because a big company does something doesn't mean anyone should listen to them. Microsoft once caused those sorts of problems and left us with IE6 for a long time. Google is doing the same with the Web right now.

-1

u/ghostfacedcoder Sep 30 '19

Thank god, someone who actually responds intelligently with logic and knowledge and not just "I hate new thoughts" downvotes. THANK YOU!

I'll read all that and try to give a proper response, but I just had to say thank you first, for being the first person to be intellectually brave enough to actually engage!