3 ms·
Then how do you inform the browser where a span ends when it is enclosed by text inside a div? A quick look at HAML and I fail to see how one is more or less v
by talmand 13y ago
Then how do you inform the browser where a span ends when it is enclosed by text inside a div?
A quick look at HAML and I fail to see how one is more or less verbose than the other. Of course, since I don't use it I suppose I'm not a valid source of comparison.
But to risk negativity, this sounds a great deal like the no semi-colons in Javascript thing a while back.
- andybak 13y agoA tag could be closed without repeating it's name. It's obvious from the DOM which tag is being closed. It's the job of code editors to help you out by matching start/close tags - not the job of the language. By the way - no semi-colons in javascript was a good idea aside from a few major factor - it broke things and it was a hack based on loose syntax handling. If it was built into the language design then it would have been a good thing.
- talmand 13y agoBut closing a tag with its name makes it clear to the person writing the code what's being closed. Think of a div that contains, say, a hundred lines of HTML. There's a habit with some people to insert a comment at the closing div to identify which div is being closed by referring to its id. What you propose is trivial to the machine, but not necessarily easier for the human. By the simple fact that no semi-colons broke things and was a hack contradicts the thought that it was a good idea. Building it into the language might be a good idea but it wasn't to try to go around the language.