News for hackers. Stuff that matters.
Re:Google HTML/CSS style guide suggests omitting head and bo... by didgeoridoo on Tuesday May 21, 2019 @11:40AM (#19971177)
Confusing title; I assumed it meant they were recommending avoiding the <main> tag, which seems weird but OK, it’s a new one and we’ve seen document outline tags get deprecated before. But no — they’re recommending avoiding the <head> and <body> tags! These are literally the first things you are taught when you learn HTML. This seems like a pretty fundamental change to have slipped in here without further explanation. What’s the reasoning?
Re:Google HTML/CSS style guide suggests omitting head and bo... by fabiomaia on Tuesday May 21, 2019 @11:46AM (#19971268)
It's explained.

> For file size optimization and scannability purposes

Omitting tags means less transfered bytes means faster websites. If the browser can forgivingly parse HTML like this, why not take advantage of it?

Of course, it doesn't sit well with me either. This'll take some time to digest, but it is interesting to consider.

Re:Google HTML/CSS style guide suggests omitting head and bo... by DanBC on Tuesday May 21, 2019 @11:50AM (#19971310)
I know it all adds up, but stripping <html><head></head><body></body></html> seems like a miniscule saving compared to the huge amounts of cruft stuffed into most websites.
Re:Google HTML/CSS style guide suggests omitting head and bo... by fabiomaia on Tuesday May 21, 2019 @12:13PM (#19971567)
That's true. Presumably this is for extreme cases when you really need that extra bit of performance.

Perhaps HTML could have been better designed with performance in mind. Every tag you open (i.e. <foo>) you're supposed to close (i.e. </foo>) which is quite redundant in terms of bytes when you think about it. It is easy to imagine markup languages that minimize the number of bytes the client has to transfer.

Re:Google HTML/CSS style guide suggests omitting head and bo... by freakonomics on Tuesday May 21, 2019 @12:19PM (#19971624)
Chrome does, what about the other smaller browsers?
Re:Google HTML/CSS style guide suggests omitting head and bo... by lwhi on Tuesday May 21, 2019 @11:47AM (#19971281)
I think Google has a set of very specific aims, that aren't so relevant to a lot of other organisations.

Cutting out optional tags will improve page size, download speed etc; something that's obviously important when you're serving so many billions of users.