TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Is HTML broken as it is, so why Jade?

3 点作者 udswagz大约 10 年前
Just to get something clear, i am a self taught web developer and i love learning new USEFULL technologies, recently i have been assigned to work on a project and it uses Jade, its a MEAN stack project and since i started using Jade, it just sucks for me, so my question is why Jade, what is worng with HTML as it is? if its not broken then why try to fix it? I feel like learning the shity Jade is like a waste of time and mental effort.

2 条评论

poof131大约 10 年前
Personally, I prefer HTML too. That’s the reason I enjoy Angular so much. It essentially allows you to use an enhanced version of HTML, so you keep the strengths of a DSL without the limitations of basic HTML.<p>But in pure HTML, how do you do something like ng-repeat?[1] You can’t. You have to either use a template language or you have to construct the HTML in the code. Both have goods and others. A template language allows you to keep an HTML like format that non-programmer’s can possibly understand and contribute to, and that can help separate the view from the business logic, but it comes at the cost of having to learn a new language &#x2F; framework and the hurdles that abstractions sometimes create.<p>Similar question on Quora. [2]<p>[1] <a href="https:&#x2F;&#x2F;docs.angularjs.org&#x2F;api&#x2F;ng&#x2F;directive&#x2F;ngRepeat" rel="nofollow">https:&#x2F;&#x2F;docs.angularjs.org&#x2F;api&#x2F;ng&#x2F;directive&#x2F;ngRepeat</a> [2] <a href="http:&#x2F;&#x2F;www.quora.com&#x2F;What-are-the-pros-and-cons-of-using-a-template-engine-like-Jade" rel="nofollow">http:&#x2F;&#x2F;www.quora.com&#x2F;What-are-the-pros-and-cons-of-using-a-t...</a>
izolate大约 10 年前
HTML is too slow. My web dev method is so streamlined at this stage, if I&#x27;m writing &lt;tags&gt; individually, I&#x27;m spending too much time on stupid shit that doesn&#x27;t really interest me.<p>Consider this takes me 45 seconds to write:<p><pre><code> &lt;div class=&quot;container&quot;&gt; &lt;div class=&quot;container__item&quot; data-id=&quot;#{item.id}&quot;&gt; &lt;h1 class=&quot;container__item__title&quot;&gt;#{item.title}&lt;&#x2F;h1&gt; &lt;&#x2F;div&gt; &lt;&#x2F;div&gt; </code></pre> Versus 15 seconds:<p><pre><code> .container .container__item(data-id=item.id) h1.container__item__title= item.title</code></pre>
评论 #9467461 未加载