Live data from Hacker News

Write HTML Like It's 1999

bradleytaunt.com

91–100 of 191 posts

Re: Write HTML Like It's 1999

#91
post #82

Really almost all of this comes down to, "don't use JavaScript to replace HTML". Everything else on this post derives from that one guideline. For example, "Implementing custom div layouts for forms while removing items like select or radio" is only possible if you're replacing native functionality with JavaScript. Which is perfectly fine advice if you aren't doing anything really novel. You probably don't need a cus…

> Content being heavily reliant on JavaScript “injection”

Salient point right here. Being served a blank white page (when JS is disabled) can deter a person from ever visiting a site again. Some peope out there want to vet a site before allowing it to run arbitrary code on their machine.

Re: Write HTML Like It's 1999

#93
post #82

Really almost all of this comes down to, "don't use JavaScript to replace HTML". Everything else on this post derives from that one guideline. For example, "Implementing custom div layouts for forms while removing items like select or radio" is only possible if you're replacing native functionality with JavaScript. Which is perfectly fine advice if you aren't doing anything really novel. You probably don't need a cus…

> Content being heavily reliant on JavaScript “injection” Salient point right here. Being served a blank white page (when JS is disabled) can deter a person from ever visiting a site again. Some peope out there want to vet a site before allowing it to run arbitrary code on their machine.

> run arbitrary code on their machine

That's a bit of an exaggeration. JavaScript is strongly sandboxed and has a pretty good permissions system. The only malicious things it can really do are 1) based on cookies or 2) crypto mining.

Personally I think it's unreasonable to expect today's sites to work without JavaScript completely. The real benefits of using it sparingly are:

- Pages load faster

- Pages are more responsive

- Applications are less stateful and call out to systems that have a larger number of eyes on them, making them less fragile and lowering maintenance complexity

Minimalism is a virtue in any programming context

Re: Write HTML Like It's 1999

#94

Earlier quoted context omitted.

> The author is arguing for semantic markup, but prior to HTML5 the concept barely existed Not really. The concept existed and was well known in many developer circles (e.g. List Apart Issue 268 from 2008 http://alistapart.com/issue/268/ ).

That's fair. Semantic markup did exist pre-HTML5. I guess I should say that HTML5 emphasized it and drove adoption. This article is from 2008, but I think it would be quite challenging to find something similar from 1999.

Semantic HTML was already fashionable in late 2004, when I was a graphic designer arguing against table tags. But my own exposure is a bad measure, just as is anyone else's. One of the most famous groups pushing for well-written HTML was WaSP, and it turns out that it was founded in 1998, https://en.wikipedia.org/wiki/Web_Standards_Project

Re: Write HTML Like It's 1999

#95
post #82

Really almost all of this comes down to, "don't use JavaScript to replace HTML". Everything else on this post derives from that one guideline. For example, "Implementing custom div layouts for forms while removing items like select or radio" is only possible if you're replacing native functionality with JavaScript. Which is perfectly fine advice if you aren't doing anything really novel. You probably don't need a cus…

> Content being heavily reliant on JavaScript “injection” Salient point right here. Being served a blank white page (when JS is disabled) can deter a person from ever visiting a site again. Some peope out there want to vet a site before allowing it to run arbitrary code on their machine.

Sadly, the majority of web devs don’t give a rat’s butt about those users.

Re: Write HTML Like It's 1999

#96
post #93

Earlier quoted context omitted.

> Content being heavily reliant on JavaScript “injection” Salient point right here. Being served a blank white page (when JS is disabled) can deter a person from ever visiting a site again. Some peope out there want to vet a site before allowing it to run arbitrary code on their machine.

> run arbitrary code on their machine That's a bit of an exaggeration. JavaScript is strongly sandboxed and has a pretty good permissions system. The only malicious things it can really do are 1) based on cookies or 2) crypto mining. Personally I think it's unreasonable to expect today's sites to work without JavaScript completely. The real benefits of using it sparingly are: - Pages load faster - Pages are more resp…

The microarchitectural side-channel attacks that have received a lot of attention lately really challenge the idea of a "sandbox".

Also the poster said that webpages shouldn't be blank without having, not that they should be fully functional. I think it's reasonable to expect some function without javascript.

Re: Write HTML Like It's 1999

#97

My God that page is beautiful. Over half the vertical space is content without me touching anything. No banner bar asking me to install some bullshit mobile app. No 800-pixel panel at the bottom telling me what a cookie is. No incredibly obnoxious warning that I only have one more free article before the wisdom of the ages is lost to me so I'd better cough up five bucks.

It is not bad, but on a regular monitor (1080p) the white space is about 60%. We don't need wide monitors just to use the center 40% of it, we cannot go Notepad style and use 100% width, I would prefer to use about 60%. That makes also the page shorter and requires less vertical scrolling. But this is picking on the page layout, not on the merits of the points in the article, that I mostly agree.

Re: Write HTML Like It's 1999

#98
post #93

Earlier quoted context omitted.

> Content being heavily reliant on JavaScript “injection” Salient point right here. Being served a blank white page (when JS is disabled) can deter a person from ever visiting a site again. Some peope out there want to vet a site before allowing it to run arbitrary code on their machine.

> run arbitrary code on their machine That's a bit of an exaggeration. JavaScript is strongly sandboxed and has a pretty good permissions system. The only malicious things it can really do are 1) based on cookies or 2) crypto mining. Personally I think it's unreasonable to expect today's sites to work without JavaScript completely. The real benefits of using it sparingly are: - Pages load faster - Pages are more resp…

3) Fingerprinting and tracking in general are heavily javascript-focused. Less common in practice (I assume), but still possible, are 4) Rowhammer or Spectre/Meltdown style attacks that break out of the permission system. Finally, there's general trickery, manipulation, and malware, like trying to embed a frame from Facebook and steal user credentials or so on (I'm fuzzy on these sorts of attacks, not an expert).

Re: Write HTML Like It's 1999

#99
post #98
post #93

Earlier quoted context omitted.

> run arbitrary code on their machine That's a bit of an exaggeration. JavaScript is strongly sandboxed and has a pretty good permissions system. The only malicious things it can really do are 1) based on cookies or 2) crypto mining. Personally I think it's unreasonable to expect today's sites to work without JavaScript completely. The real benefits of using it sparingly are: - Pages load faster - Pages are more resp…

3) Fingerprinting and tracking in general are heavily javascript-focused. Less common in practice (I assume), but still possible, are 4) Rowhammer or Spectre/Meltdown style attacks that break out of the permission system. Finally, there's general trickery, manipulation, and malware, like trying to embed a frame from Facebook and steal user credentials or so on (I'm fuzzy on these sorts of attacks, not an expert).

Before javascript took over tracking the 1x1 white pixel ruled the land. No javascript needed there.

Re: Write HTML Like It's 1999

#100

Instead of a border I tend to have a debug helper that adds a 1px outline of cyan or pink. To get the “bones” of a component or page. Good advice. Definitely sounds like captain obvious but it’s also something I think needs to be said.

Addy Osmani has a "one-line debugger" that gives each element on the page a random colored outline.

    [].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1
https://gist.github.com/addyosmani/fd3999ea7fce242756b1
Post reply on HN