What's the need for XHTML?

后端 未结 16 2191
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-08 13:58

In an interview I was asked a question that I\'d never thought about, which was \"We already have HTML which fulfills all the requirements of writing a web page, so what\'s

16条回答
  •  青春惊慌失措
    2020-12-08 14:44

    Because XHTML makes a lot more sense!

    The point is, even though something might not provide any more technical possibilities, it's still an improvement if it's remade just to be more clear and logical. That's why code refactoring is a good idea even if it doesn't change any of the functionality. That's why Brainfuck wound't be a good programming language, even if it had all the capabilities of Java.

    XHTML makes more sense because the underlying structure of tags and their attributes is always consistent - not dependent on the tag semantics. The way it makes more sense is pretty evident, once you get familiar with its difference to HTML, but for example tags are always orderly nested, all tags must close, names must be lowercase, attribute values must have limiting characters around them.

提交回复
热议问题