4 ms·
In order to put a slash there, you need to already know that tag can take a slash, so nothing is gained by putting it there. Though something is allowed, it is
by assimpleaspossi 3y ago
In order to put a slash there, you need to already know that tag can take a slash, so nothing is gained by putting it there.
Though something is allowed, it is unspecified, not required, does nothing. So why would you want to write markup that is not needed and does nothing? This makes no sense whatsoever and I only find such discussions on public forums such as this one.
- ricardobeat 3y agoThis is about readability. The point is that only if you _don't_ have an ending slash, you need to know the tag type. If there is one, you don't need to know anything to understand the tree structure, the code is self-evident. Do you add quotes to your single-word attribute values? Why? They are also unnecessary following the spec: https://html.spec.whatwg.org/#unquoted https://html.spec.whatwg.org/#unquoted Do you omit the opening html tag because it's optional? https://html.spec.whatwg.org/#optional-tags https://html.spec.whatwg.org/#optional-tags Do you write unclosed <dd> tags? Do you close your paragraph elements? The spec allows a lot of questionable styles, your argument that because something is not required it is superfluous doesn't hold any water.
- assimpleaspossi 3y agoYour use of the word superfluous is exactly what I'm saying. Why you want to write unnecessary, useless markup is beyond me. Even MDN and the W3C complain about it but that seems to mean nothing to you but I can tell when I can't teach someone values so I'm done here.
- ricardobeat 3y agoI see in your profile you've joined HN just a year ago. Welcome! I feel the need to point out that this is not a place to "teach someone values" though, but to have meaningful conversation. There doesn't have to be a winner. The comments section of the guidelines offers some good rules of thumb: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html