Hacker News new | ask | show | jobs
by trumpete 4026 days ago
> Because HTML forces us to repeat the name of the tag in the close tag, it encourages us to write things like:

   the <b>goto <u>label</b></u> statement
What sort of demonic possession bullshit going on here? Who is "encouraged" to do such thing?
2 comments

You are, presumably, already a developer, so you already understand nesting. Perhaps a better example that a beginner could find quite reasonable after learning about start and end tags:

   <u>Underlined. <b>Bold and underlined.</u> Bold only.</b>
Why shouldn't that work?
This is a much better example of the point the author was trying to illustrate.

Though I'm not sure sure if the HTML / TeX comparison is the best to exemplify the concept. I feel that if a beginner were to make the conceptual mistake that HTML tags are not nested that they may also not grasp that {}'s are to be nested as well. Thus falling into the same trap as HTML.

I'll admit that {}'s look more obvious to form a nested structure but it may also be that my eyes are trained to see them exactly as such.

Fun thing is: HTML goes out of its way to ensure that this does work.
That's not allowed because parsing that kind of nesting requires a context sensitive parser, which is much more expensive computationally than context free parsers.
I understand that, you understand that, and your parent commenter probably understands that, but the point is that a user of HTML should not have to understand it.
IRC formatting codes (not standard, but popularized by mIRC and thus implemented by most clients) are also toggles instead of begin-end pairs, so they allow this. If I remember correctly, old text processors like WordStar also implemented formatting as toggles.
I guess the OP means something more like "HTML makes it easy to make mistakes like ..." which is true. I believe English is not his native language.
I think that is what the author means, but I also think it's a valid usage; it's ironic.