From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32e9e18947de9391 X-Google-Attributes: gid103376,public From: "John Duncan" Subject: Re: Comments at the End of Lines Date: 1999/07/02 Message-ID: <7lir0r$og1$1@usenet01.srv.cis.pitt.edu>#1/1 X-Deja-AN: 496479764 References: X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: University of Pittsburgh X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 1999-07-02T00:00:00+00:00 List-Id: > Finally, not related to Ada, a C style guide I was asked to review had a rule > that said not to put comments at the end of lines. I'm not exactly sure, but if you consider the C example, comments on the same line tend to be used to "explain" a very mangled semantic structure. As far as the meaning of each line is concerned, you shouldn't need comments at the end of the line. Consider: Beta := Sqrt(X); -- Assign sqrt(x) to beta There are a lot of programmers who are told to write comments and put these things in. It's not good style, obviously. What is good style is something like: Obscure := Strange(Odd); -- This actually gets translated to Greek. When you have something weird to explain that you can't escape. There's a problem, though, that the space between the semi and the margin is very small, and you can't explain very well. This example may have been better as: Obscure := Strange(Odd); -- This actually gets translated into ancient Greek c. 230BC. -- Homer wrote the function and no one knows what it does, -- but it has faithfully produced the correct value each time. So that's the best I can do:) -John