Re: The semicolon habit (Mark Hopkins)
Wed, 10 May 1995 22:30:43 GMT

          From comp.compilers

Related articles
Re: The semicolon habit (1995-05-10)
Re: The semicolon habit (1995-05-11)
Re: The semicolon habit (1995-05-15)
Re: The semicolon habit (1995-05-17)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Mark Hopkins)
Keywords: syntax
Organization: Omnifest
Date: Wed, 10 May 1995 22:30:43 GMT

      I simply don't agree with any of the original poster's assertions.

      First of all, syntax errors are far too trivial to be of any relevance
in any discussion. It might have been a concern back in the old days when
a programmer had to (re)submit a program to a central site, but nowadays
it's an entirely trivial matter to pipe an entire error listing back into a
program and eliminate all the errors in one fell swoop and usually doesn't
take much more of a minute.

      Second, experienced programmers simply don't make that many syntax errors.

      Third, I personally don't have any problems with the semicolon syntax in
C and in fact find it accords quite well with natural usage style in human
languages. Arguing against punctuation for delimiters in a programming
language (especially when the alternative is nested bracking of some kind
which is inimical to natural language and natural style (apparently except
German (which probably explaiuns why the Pascaloids and Moduloids seem to
have Teutonic heritage and affinity))) is a lot like arguing against the use
of periods at the end of sentences.

      Fourth, as per the comment that nobody in their right mind uses {...}
without indentation: I'm in my right mind, but I don't always indent.
I use a VERY great multiplicity of stylistic forms, often based on
semantic, layout and context considerations, including the following:

                            if (A) S

                            if (A) S, S, ..., S

                            if (A) { S; S; S; S; ...; S; }

                            if (A)
                                  S, S, ..., S,
                                  S, S, ..., S,
                                  S, S, ..., S

                            if (A) {
                                  S; S; ..., S;
                                  S; S; ..., S;
                                  S; S; ..., S;

                            if (A) while (B) ...

                            if (A)
                                  while (B) ...

                            if (A)
                            while (B) ...

                            for (...)
                            for (...)

                            for (...)
                                  for (...)

and forcing layout for the compiler's sake is going to destroy all of this.

      You may argue that this obfuscates code. No quite the opposite.
The use of expressivity to reflect intention not only clarifies
matters but, to prove the point, I can literally go back into code I
haven't written in years (and have) and immediately see what the intended
meaning was *even without comments*. Of course, part of that also have
to do with the naming conventions I use too. This ability is the one
determinant and main function of proper style.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.