Live data from Hacker News

Write HTML Like It's 1999

bradleytaunt.com

101–110 of 191 posts

Re: Write HTML Like It's 1999

#101
post #30

Don't get me wrong, I used to write as semantic HTML as I could; nav for navigations, table for table's, aside for well asides, etc as the author suggests, but ultimately it just really doesn't matter. nav and div render exactly the same. In fact, I find zero value in using ul/li's for lists that aren't bulleted. I know it's an unordered list of items, but really, what _is_ the value in writing semantic HTML if the d…

Ever tried to use your pages with a screen reader? It's quite an interesting (and potentially maddening - screen readers are power-user tools, and quite difficult to get into if that's not how you normally operate) exercise.

I tried doing this once, and I wasn't even able to install the damned thing. If you've got any advice or instructions on how to get started with a screen reader for testing purposes, I'd be really interested.

Re: Write HTML Like It's 1999

#102
post #4

I feel like there's strong friction between HTML trying to semantically describe the structure of a page page and JS frameworks where you try to build custom reusable components which might not fall into the rigid structure defined by classic HTML.

That's because people are trying to use HTML for applications rather than documents.

Re: Write HTML Like It's 1999

#103
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 only malicious things

And a crappy end user experience. Why do I need to execute code just to read a static, read-only text article?

Re: Write HTML Like It's 1999

#104
My biggest gripe with how modern html is written is not using tags for link-like things. I often center click to open links in new tabs (Chrome and Firefox support this), but the way links have changed to with a listener attached that navigates to a new page--sometimes in a new window--really annoys me.

Re: Write HTML Like It's 1999

#105
So many people seemed to have forgotten what HTML in 1999 looked like. Layouts done with s. Extreme nesting to get layout just right. 1px spacer gifs everywhere. tags. Very little CSS. Despair in the messiness of HTML and hope XHTML or whatever XML-based alternative was going to eat your lunch.

Semantic HTML only came back in the 2000s. Remember CSS Zen garden? Write HTML once and style it differently to achieve completely different looks. Even then, you had huge amount of CSS bugs. Like the voice-family hack or the

    * > html 
selector. Reading up on standards mode and quirks mode.

Re: Write HTML Like It's 1999

#106
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…

> The one part I disagree with is necessarily using in place of divs with CSS Grid.

I suppose the soundness depends on how you read the word "table". For actual tabular data, is probably the right choice for accessibility reasons. It's also why it's usually a bad idea to abuse tables for grid layouts in other cases.

Re: Write HTML Like It's 1999

#107
post #29
post #22

Earlier quoted context omitted.

When done properly, it increases the separation between the actual content, and the styling on top of it. Any time you get closer to that ideal separation, accessibility is enhanced (and it’s also forward-thinking towards yet-unknown methods of accessibility assistance).

IMO this is an example of extreme overengineering and premature optimization. Unstyled html is so ugly and inconsistent across browsers that it’s just not a realistic scenario that it would be consumed without the css and js that make up the rest of the code. When an alternate display method comes out and wants my semantic html, I will add it to my QA workflow and make sure that it looks good instead of relying on so…

> Unstyled html is so ugly

This comment made me realize how relative everything is. It seems it was yesterday, when you would open Mosaic and slowly discover completely different worlds, one after another, and you'd never think of complaining HTML was aesthetically unpleasant...

Re: Write HTML Like It's 1999

#108

I didn’t find this particularly insightful, and disagree with many of the points made. First of all the post is arguing for more semantic HTML and says nothing about using semantic HTML5 tags over ? AFAIK semantic tags didn’t even exist before HTML5 which is definitely not the 90s. I also find using the element generally be bad practice. There are much better/easier ways to build responsive tables using grid or flexb…

> I also find using the element generally be bad practice. There are much better/easier ways to build responsive tables using grid or flexbox than dealing with // everywhere.

Try using that monstrosity in a screen reader. You completely break vertical/column navigation. Hardly better.

Re: Write HTML Like It's 1999

#109
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).

3) Right - and I guess "fingerprinting" goes slightly beyond cookies - but when people say "execute arbitrary code" they typically imply something has free-reign, which JavaScript generally doesn't.

4) True, although it's my understanding that the exploits are hard to implement, doubly-so from an abstracted layer like JavaScript.

> trickery, manipulation...like trying to embed a frame from Facebook and steal user credentials or so on

This falls under "cookies-based", and I'm pretty sure no JavaScript is necessary for these kinds of attacks.

Re: Write HTML Like It's 1999

#110
post #106
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…

> The one part I disagree with is necessarily using in place of divs with CSS Grid. I suppose the soundness depends on how you read the word "table". For actual tabular data, is probably the right choice for accessibility reasons. It's also why it's usually a bad idea to abuse tables for grid layouts in other cases.

I felt it was clear that the argument was should be used for tables. S/he made no mention of layout.
Post reply on HN