emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTML-Info design


From: Yuri Khan
Subject: Re: HTML-Info design
Date: Mon, 29 Dec 2014 21:36:02 +0700

On Mon, Dec 29, 2014 at 5:40 PM, Lars Ingebrigtsen <address@hidden> wrote:

>> With implicit tags, browsers can and will infer tag nesting on their
>> own, and have an intricate system of rules to do so.
>
> Yeah, that's why all Python code looks like
>
>  for x in range(10): # THE LINE ENDED THERE
>      squares.append(x**2)  # THE FOR ENDS HERE I PROMISE!!!

Interesting that you take for an example Python, a language with very
clear rules on where indented blocks end.

Rather, let’s take C.

In C, indentation is insignificant. For that matter, all whitespace is
insignificant (except in string literals). But we don’t write our
programs all in one line, and we indent consistently, and we choose
either spaces or tabs but not both, even though the compiler doesn’t
give a damn either way.

Also in C, braces are optional if there is only a single statement
inside. But most coding style guides at least STRONGLY RECOMMEND
spelling out all braces explicitly, and often REQUIRE that.

Parentheses are often redundant thanks to the operator precedence
rules, but the GNU Coding Standard RECOMMENDs spelling out parentheses
where doing so helps readability.

Optional tags in HTML are closest to optional parentheses, except that
the precedence of HTML elements is much more intricate than the
precedence of C operators, and so explicit closing tags help
readability almost always, except for the simplest of cases.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]