DEV Community

Discussion on: TIL: You can leave out html, head, and body tags in your HTML.

Collapse
 
aleksandrhovhannisyan profile image
Aleksandr Hovhannisyan • Edited

Well, kilobytes are made of bytes. If you have 100 similar optimizations, you'll start seeing the differences.

That's a bit like saying that $1,000,000 is made of $1 bills (technically true), and you'll eventually become a millionaire if you collect enough $1 bills (not necessarily true, and almost always false).

Every optimization incurs a cost—on maintainability, legibility, and time. There are far better ways to minify your HTML and other assets, like with compression.

Think of this in terms of opportunity cost. Why save 39 bytes when you could save more, by working on more meaningful optimizations? Time is money.

Thread Thread
 
shadowfaxrodeo profile image
Nathaniel

I totally understand what you're saying. I personally enjoy little things like this so I'm happy to do them. i wouldn't expect every developer to take the time to do this on every individual website.

But there are situations where doing this would save 39 bytes on lots of other people's sites. Like if you're building a template of some kind. then you really ought to take the time to do this sort of thing.