News for hackers. Stuff that matters.
Re:The thing I hate about HTML (2010) by austenallred on Tuesday March 10, 2015 @10:04PM (#9182104)
Saying we should write HTML using the following syntax?:

(div class="red"

  (p

    (Hello, World!)

  )
)

I'm not sure what problem this solves. It eliminates the tiny bit of work that is typing the extra characters in a closing tag, and in doing so you lose all of the other information as to what exactly you're trying to close. The end of most HTML douments would be ))))))) (plus a mess of indenting).

I can see this causing many more problems than it would solve; I'm okay with typing three extra characters to avoid lack of confusion.

The current syntax may not be ideal, but I don't think removing the object type from a closing tab is a good way to make it better.

Re:The thing I hate about HTML (2010) by lfowles on Tuesday March 10, 2015 @10:19PM (#9182152)
Hah, but aren't most HTML documents a mess of </div></div></div></div> at some point :)
Re:The thing I hate about HTML (2010) by icantthinkofone on Tuesday March 10, 2015 @10:35PM (#9182206)
Not when you know what you're doing and don't use auto code generators.
Re:The thing I hate about HTML (2010) by lfowles on Tuesday March 10, 2015 @11:08PM (#9182343)
What is "knowing what you're doing?" I'm honestly curious, because I handwrote most of the HTML on my website and I don't know how to have it cleaner than something like this:

  </div> <!-- footer -->
  </footer>
  </div> <!-- row -->
  </div> <!-- container -->
  
(If you actually look at the website, it will be pretty obvious that I'm no skilled web dev)
Re:The thing I hate about HTML (2010) by krapp on Tuesday March 10, 2015 @11:27PM (#9182411)
Indenting all of the tags would help, but that's probably about it.

    <div>
       <footer>
       </footer>
    </div>
Re:The thing I hate about HTML (2010) by TylerE on Tuesday March 10, 2015 @11:36PM (#9182449)
In theory, maybe.

In practice, where the code is coming from 3 or 4 different levels of templating? Bets are off.

Re:The thing I hate about HTML (2010) by krapp on Tuesday March 10, 2015 @11:46PM (#9182483)
I use Twig for templating a lot, and I have to admit that while I indent per template, i don't even bother keeping track between parent and child.

But then, Twig has its own weird issues sometimes with adding whitespace so I've given up caring how templated html works altogether in that case.

Re:The thing I hate about HTML (2010) by moron4hire on Tuesday March 10, 2015 @11:37PM (#9182454)
Assuming a mythical "knows what they are doing" user, then parens aren't any different.
Re:The thing I hate about HTML (2010) by mrits on Tuesday March 10, 2015 @10:52PM (#9182280)
Are you really on hackernews bragging about HTML skills?
Re:The thing I hate about HTML (2010) by luchadorvader on Tuesday March 10, 2015 @11:06PM (#9182326)
Bragging? I don't think s/he is bragging, but just saying that html can be done wrong.
Re:The thing I hate about HTML (2010) by minikomi on Wednesday March 11, 2015 @06:49AM (#9183450)
Editing structures like this using paredit is quite easy and fun though - once you're over the hump.
Re:The thing I hate about HTML (2010) by ely-s on Tuesday March 10, 2015 @10:50PM (#9182268)
The only use for this I can think of would be to make it take less characters.
Re:The thing I hate about HTML (2010) by simplicio on Tuesday March 10, 2015 @11:46PM (#9182486)
which is good, because I keep running out. :)
Re:The thing I hate about HTML (2010) by krapp on Tuesday March 10, 2015 @11:26PM (#9182403)
It solves a problem which vexes many Lisp programmers, which is the existence of data structures and languages which are not lispy.