Wikipedia:Reference desk/Archives/Computing/2015 May 17

= May 17 =

What type of HTML uses indenting instead of closing tags?
I once saw a version of HTML that relied on whitespace instead of closing tags to end scope, sort of similar to CoffeeScript. Does anyone know the name of this variant of HTML? A Quest For Knowledge (talk) 21:39, 17 May 2015 (UTC)


 * Some HTML tags don't need to be closed, like the br tag used between lines 1 and 2, without the closing tag, and between 2 and 3, with the closing tag:

1 2 3


 * StuRat (talk) 21:48, 17 May 2015 (UTC)


 * What I am saying is that in most languages, white space is not significant in how code is written. However, there are some languages where white space matters.   For example, in JavaScript, white space doesn't matter.  You could code this:

if (true) { doSomething; } else { doSomethingElse; }


 * ...which is semantically identical to this...

if (true) { doSomething; } else { doSomethingElse; }


 * ...which is semantically identical to this...

if (true) { doSomething; } else { doSomethingElse; }


 * But the equivalent CoffeeScript has no scope terminators such as closing brackets. Instead, it relies on indentation to determine scope.  So, this is how you would write the identical code in CoffeeScript:

if true doSomething else doSomethingElse


 * ...whereas this would mean something completely different (I'm not sure that this code would even transcompile) ...

if true doSomething else doSomethingElse
 * I once saw a version of HTML that worked the same way. Instead of closing tags, it relied on white space to determine scope.  So, instead of this...

This is a title Hello world!


 * ...it looked something like this...

This is a title Hello world!


 * A Quest For Knowledge (talk) 22:06, 17 May 2015 (UTC)
 * Have you any more context? For instance, Hamlet templates can look like this. They aren't really a 'version' of HTML, but nor - I think - was whatever you remember. 82.13.241.56 (talk) 23:16, 17 May 2015 (UTC)


 * I once used a language for a CNC punch machine that didn't allow empty spaces at the ends of lines. It would give me very strange errors when it happened and it took me at least an hour to find the problem the first time it happened since a space isn't visible. I eventually found it by mistake when I happened to put the cursor at the end of the line and noticed the space.  You can bet your life that I never forgot about that error!  But this was not HTML.  Dismas |(talk) 23:44, 17 May 2015 (UTC)


 * Also see: Whitespace (programming language)... --Guy Macon (talk)


 * It could have been Hamlet, or something similar to it. A Quest For Knowledge (talk) 20:14, 18 May 2015 (UTC)