TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why do we still build the web in XML?

7 pointsby mikercampbellover 2 years ago
I know that JSX and HTML aren&#x27;t XML, but they practically are. Yes, there are template engines, and markdown, but they both transpile to HTML, and because of that they&#x27;re forced or at least limited by it&#x27;s basic &quot;isms&quot; of structure. Or have I not been using the right ones??<p>Sorry, I&#x27;m tired of closing &lt;div&gt; tags.

7 comments

mindcrimeover 2 years ago
Plenty of alternatives for you to use:<p>1. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Gopher_(protocol)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Gopher_(protocol)</a><p>2. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Wide_area_information_server" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Wide_area_information_server</a><p>3. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Project_Xanadu" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Project_Xanadu</a><p>4. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;HyperCard" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;HyperCard</a><p>5. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Java_applet" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Java_applet</a><p>6. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;NeWS" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;NeWS</a><p>And so on...<p>Upon further consideration, maybe just closing the &lt;div&gt; tags isn&#x27;t so bad after all...
评论 #34050468 未加载
jaredcwhiteover 2 years ago
The question is, why are you writing &lt;div&gt; tags? Between the wide variety of semantic elements now in HTML, and the ability to create your own via custom elements, the number of times you actually need to use divs—especially &quot;div tag soup&quot; that we unfortunately see all too often out in the wild—has dropped to nearly nil.<p>Viva la semantic and expressive HTML code!
gjvcover 2 years ago
<i>Sorry, I&#x27;m tired of closing &lt;div&gt; tags.</i><p>Avoid this feeling of mental toil by using a text editor which does this for you.
评论 #34048384 未加载
salamoover 2 years ago
If you&#x27;re worried that HTML is too verbose and therefore inefficient, that&#x27;s not really an issue since it&#x27;s going to be compressed in transit anyways. So then the question is, assuming that the compressed representation has the maximum information density, &quot;what format should the decompressed web page be in&quot;. I think HTML is a pretty logical format to view the structure of the page.<p>There are definitely plugins for auto-closing your HTML tags that will make your life easier, though.
gardenfelderover 2 years ago
So, what would you suggest as an alternative?<p>XML fell out of SGML - trust me, you don&#x27;t want to go there. So did HTML.<p>Also too: the IDEs I use always form closed tags. No effort needed.
quickthrower2over 2 years ago
HTML over the wire, but feel free to use YAML.<p>JSX may have solidified the XML markup style in the developer&#x27;s toolbox though. Especially with server side rendering too.
thesuperbigfrogover 2 years ago
A better question is why Javascript is still being used:<p><a href="https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;wat" rel="nofollow">https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;wat</a><p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;D5xh0ZIEUOE" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;D5xh0ZIEUOE</a><p>Can&#x27;t we just get WASM browser APIs and then do the web in whatever programming language we want?
评论 #34048556 未加载