

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

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.
======
poof131
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.

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 / framework and the
hurdles that abstractions sometimes create.

Similar question on Quora. [2]

[1]
[https://docs.angularjs.org/api/ng/directive/ngRepeat](https://docs.angularjs.org/api/ng/directive/ngRepeat)
[2] [http://www.quora.com/What-are-the-pros-and-cons-of-using-
a-t...](http://www.quora.com/What-are-the-pros-and-cons-of-using-a-template-
engine-like-Jade)

------
izolate
HTML is too slow. My web dev method is so streamlined at this stage, if I'm
writing <tags> individually, I'm spending too much time on stupid shit that
doesn't really interest me.

Consider this takes me 45 seconds to write:

    
    
        <div class="container">
          <div class="container__item" data-id="#{item.id}">
            <h1 class="container__item__title">#{item.title}</h1>
          </div>
        </div>
    

Versus 15 seconds:

    
    
        .container
          .container__item(data-id=item.id)
            h1.container__item__title= item.title

~~~
hacym
If you are hand typing each and every one of those characters by hand you're
doing it wrong. There are a lot of projects out there aimed at making writing
HTML faster.

For example, [http://emmet.io/](http://emmet.io/)

The problem with your "15 seconds" example is that it is almost completely
unreadable. .container? Ok, .container what? Is it a <p>? <div>? <span>? I
think you're losing a lot more by trying to gain 30 seconds of time.

~~~
bramgg
> The problem with your "15 seconds" example is that it is almost completely
> unreadable. .container? Ok, .container what? Is it a <p>? <div>? <span>?

It takes 2 seconds to learn and forever on know that Jade defaults non-
specified tags to divs.

For me Jade is faster to both write and read.

~~~
hacym
Sorry, but my, and most people's, thoughts, is that code should be easy to
read and understand what's going on. Jade does not do that. It might take "two
seconds" to learn, that's extra time that you're wasting going and looking it
up. It's much simpler to just write <div class="container">, that way everyone
who knows HTML and looks at your code will know what's going on. Jade is
bucking a standard for no real added benefit.

~~~
udswagz
i totally agree with you

