5 ms·
Saying we should write HTML using the following syntax?: (div class="red" (p (Hello, World!) ) ) I'm not sure what problem this solves. It elimina
by austenallred 12y ago
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.
- lfowles 12y agoHah, but aren't most HTML documents a mess of </div></div></div></div> at some point :)
- icantthinkofone 12y agoNot when you know what you're doing and don't use auto code generators.
- mrits 12y agoAre you really on hackernews bragging about HTML skills?
- luchadorvader 12y agoBragging? I don't think s/he is bragging, but just saying that html can be done wrong.
- lfowles 12y agoWhat 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)
- krapp 12y agoIndenting all of the tags would help, but that's probably about it. <div> <footer> </footer> </div>
- TylerE 12y agoIn theory, maybe. In practice, where the code is coming from 3 or 4 different levels of templating? Bets are off.
- krapp 12y agoI 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.
- moron4hire 12y agoAssuming a mythical "knows what they are doing" user, then parens aren't any different.
- ely-s 12y agoThe only use for this I can think of would be to make it take less characters.
- simplicio 12y agowhich is good, because I keep running out. :)
- krapp 12y agoIt solves a problem which vexes many Lisp programmers, which is the existence of data structures and languages which are not lispy.
- minikomi 12y agoEditing structures like this using paredit is quite easy and fun though - once you're over the hump.