Live data from Hacker News

Tags to make HTML work like you expect

blog.jim-nielsen.com

31–40 of 248 posts

Re: Tags to make HTML work like you expect

#32
> is what you want for consistent rendering. Or if you prefer writing markup like it’s 1998. Or even if you eschew all societal norms. It’s case-insensitive so they’ll all work.

And if you want polyglot (X)HTML.

Re: Tags to make HTML work like you expect

#34
post #28

Earlier quoted context omitted.

Didn't know you can omit .. but I prefer for clarify to keep them.

Do you also spell out the implicit in all your tables for clarity?

I do.

`` and ``, too, if they're needed. I try to use all the free stuff that HTML gives you without needing to reach for JS. It's a surprising amount. Coupled with CSS and you can get pretty far without needing anything. Even just having `` with minimal JS enables a ton of 'interactivity'.

Re: Tags to make HTML work like you expect

#35
post #24
post #19

Anyone else prefer to use web components without bundling? I probably should not admit this, but I have been using Lit Elements with raw JavaScript code. Because I stopped using autocomplete awhile ago. I guess not using TypeScript at this point is basically the equivalent for many people these days of saying that I use punch cards.

37 Signals [0] famously uses their own Stimulus [1] framework on most of their products. Their CEO is a proponent of the whole no-build approach because of the additional complexity it adds, and because it makes it difficult for people to pop your code and learn from it. [0]: https://basecamp.com/ [1]: https://stimulus.hotwired.dev/

Dunno. You can build without minifying if you want it to be (mostly) readable. I wouldn’t want to give up static typing again in my career.

Re: Tags to make HTML work like you expect

#36
post #30

Earlier quoted context omitted.

Are they proprietary? How? Isn't open graph a standard and widely implemented by many parties, including many open source softwares?

They're not, at all. It was invented by Facebook, but it's literally just a few lines of metadata that applications can choose to read if they want.

Being invented by $company does not preclude it from being a standard.

https://en.wikipedia.org/wiki/Technical_standard

> A technical standard may be developed privately or unilaterally, for example by a corporation, regulatory body, military, etc.

PDF is now an international standard (ISO 32000) but it was invented by Adobe. HTML was invented at the CERN and is now controlled by W3C (a private consortium). OpenGL was created by SGI and is maintained by the Khronos Group.

All had different "ownership" paths and yet I'd say all of them are standards.

Re: Tags to make HTML work like you expect

#37
post #28

Earlier quoted context omitted.

Didn't know you can omit .. but I prefer for clarify to keep them.

Do you also spell out the implicit in all your tables for clarity?

Yes. Explicit is almost always better than implicit, in my experience.

Re: Tags to make HTML work like you expect

#38
I know this was a joke:

   
   
but I feel there is a last tag missing:

   ...
that will ensure screenreaders skip all your page "chrome" and make life much easier for a lot of folks. As a bonus mark any navigation elements inside main using (or role="navigation").

Re: Tags to make HTML work like you expect

#39
post #16

Earlier quoted context omitted.

Wow. This reminds me of Google Sheets formulas, where function parameters are separated with , or ; depending on locale.

Not to mention the functions are also translated to the other language. I think both these are the fault of Excel to be honest. I had this problem long before Google came around. And it's really irritating when you have the computer read something out to you that contains numbers. 53.1 km reads like you expect but 53,1 km becomes "fifty-three (long pause) one kilometer".

> Not to mention the functions are also translated to the other language.

This makes a lot of sense when you recognize that Excel formulas, unlike proper programming languages, aren't necessarily written by people with a sufficient grasp of the English language, especially when it comes to more abstract mathematical concepts, which aren't taught in secondary English language classes at school, but it in their native language mathematics classes.

Re: Tags to make HTML work like you expect

#40

Note that and auto-close and don't need to be terminated. Also, wrapping the tags in an actual is optional. You also don't need the quotes as long the attribute doesn't have spaces or the like; is OK. (kind of pointless as the average website fetches a bazillion bytes of javascript for every page load nowadays, but sometimes slimming things down as much as possible can be fun and satisfying)

This kind of thing will always just feel shoddy to me. It is not much work to properly close a tag. The number of bytes saved is negligible, compared to basically any other aspect of a website. Avoiding not needed div spam already would save more. Or for example making sure CSS is not bloated. And of course avoiding downloading 3MB of JS. What this achieves is making the syntax more irregular and harder to parse. I w…

> It would greatly simplify browser code and HTML spec.

I doubt it would make a dent - e.g. in the "skipping " case, you'd be replacing the error recovery mechanism of "jump to the next insertion mode" with "display an error", but a) you'd still need the code path to handle it, b) now you're in the business of producing good error messages which is notoriously difficult.

Something that would actually make the parser a lot simpler is removing document.write, which has been obsolete ever since the introduction of the DOM and whose main remaining real world use-case seems to be ad delivery. (If it's not clear why this would help, consider that document.write can write scripts that call document.write, etc.)

Post reply on HN