Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Polymer physicists are into chains.


devel / comp.lang.c / Re: Block Comments Or Rest-Of-Line Comments?

SubjectAuthor
* Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
+- Re: Block Comments Or Rest-Of-Line Comments?bart
+* Re: Block Comments Or Rest-Of-Line Comments?Mikko
|`* Re: Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
| `* Re: Block Comments Or Rest-Of-Line Comments?David Brown
|  +- Re: Block Comments Or Rest-Of-Line Comments?Blue-Maned_Hawk
|  `* Re: Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
|   +* Re: Block Comments Or Rest-Of-Line Comments?Chris M. Thomasson
|   |`- Re: Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
|   `* Re: Block Comments Or Rest-Of-Line Comments?David Brown
|    `- Re: Block Comments Or Rest-Of-Line Comments?Malcolm McLean
+* Re: Block Comments Or Rest-Of-Line Comments?Scott Lurndal
|`* Re: Block Comments Or Rest-Of-Line Comments?Tim Rentsch
| `* Re: Block Comments Or Rest-Of-Line Comments?Dan Cross
|  `* Re: Block Comments Or Rest-Of-Line Comments?Tim Rentsch
|   `- Re: Block Comments Or Rest-Of-Line Comments?Dan Cross
+- Re: Block Comments Or Rest-Of-Line Comments?Blue-Maned_Hawk
+* Re: Block Comments Or Rest-Of-Line Comments?David Brown
|`* Re: Block Comments Or Rest-Of-Line Comments?Richard Harnden
| +* Re: Block Comments Or Rest-Of-Line Comments?Keith Thompson
| |+* Re: Block Comments Or Rest-Of-Line Comments?Richard Harnden
| ||`* Re: Block Comments Or Rest-Of-Line Comments?Keith Thompson
| || +- Re: Block Comments Or Rest-Of-Line Comments?Richard Harnden
| || `* Re: Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
| ||  `- Re: Block Comments Or Rest-Of-Line Comments?Keith Thompson
| |+* Re: Block Comments Or Rest-Of-Line Comments?Scott Lurndal
| ||`* Re: Block Comments Or Rest-Of-Line Comments?Kaz Kylheku
| || `- Re: Block Comments Or Rest-Of-Line Comments?paul
| |+* Re: Block Comments Or Rest-Of-Line Comments?Kaz Kylheku
| ||`- Re: Block Comments Or Rest-Of-Line Comments?Keith Thompson
| |`* Re: Block Comments Or Rest-Of-Line Comments?James Kuyper
| | +- Re: Block Comments Or Rest-Of-Line Comments?Keith Thompson
| | `- Re: Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
| `- Re: Block Comments Or Rest-Of-Line Comments?David Brown
+* Re: Block Comments Or Rest-Of-Line Comments?fir
|`- Re: Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
+- Re: Block Comments Or Rest-Of-Line Comments?Malcolm McLean
+* Re: Block Comments Or Rest-Of-Line Comments?DFS
|+- Re: Block Comments Or Rest-Of-Line Comments?Lawrence D'Oliveiro
|`* Re: Block Comments Or Rest-Of-Line Comments?Blue-Maned_Hawk
| +* Re: Block Comments Or Rest-Of-Line Comments?Sjouke Burry
| |`- Re: Block Comments Or Rest-Of-Line Comments?Blue-Maned_Hawk
| `* Re: Block Comments Or Rest-Of-Line Comments?DFS
|  `* Re: Block Comments Or Rest-Of-Line Comments?Blue-Maned_Hawk
|   +- Re: Block Comments Or Rest-Of-Line Comments?Chris M. Thomasson
|   `- Re: Block Comments Or Rest-Of-Line Comments?DFS
+* Re: Block Comments Or Rest-Of-Line Comments?Kaz Kylheku
|`* Re: Block Comments Or Rest-Of-Line Comments?Lowell Gilbert
| +* Re: Block Comments Or Rest-Of-Line Comments?Ben Bacarisse
| |`- Re: Block Comments Or Rest-Of-Line Comments?Lowell Gilbert
| `- Re: Block Comments Or Rest-Of-Line Comments?Kaz Kylheku
`- Re: Block Comments Or Rest-Of-Line Comments?paul

Pages:123
Re: Block Comments Or Rest-Of-Line Comments?

<v0ha21$3ujjm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35161&group=comp.lang.c#35161

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pau...@paulglover.net.invalid
Newsgroups: comp.lang.c
Subject: Re: Block Comments Or Rest-Of-Line Comments?
Date: Fri, 26 Apr 2024 22:32:34 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 65
Sender: Paul Glover <paul@bsd.lan>
Message-ID: <v0ha21$3ujjm$1@dont-email.me>
References: <utgjh0$21nsq$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 27 Apr 2024 00:32:34 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="96479a0e6d4a6889390c4a7ab23bc8c8";
logging-data="4148854"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2430bSyofAUf5PWl5gynkZVTSLFuBVvY="
User-Agent: tin/2.6.3-20231224 ("Banff") (FreeBSD/14.0-RELEASE (amd64))
Cancel-Lock: sha1:Sq+F8HJhJ0M647nw8qDvnWAXoxo=
 by: pau...@paulglover.net.invalid - Fri, 26 Apr 2024 22:32 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> Since then, I’ve seen newer programmers gravitate towards the rest-of-line
> form in preference to the block form, and I’m not sure why. I’m fond of
> writing things like
>
> /*
> A very simple HTML/XML entity-escape function--why isn’t this
> part of the standard Java API?
> */
>
> which involve less typing than
>
> //
> // A very simple HTML/XML entity-escape function--why isn’t this
> // part of the standard Java API?
> //

For me, it's block form for larger blocks of comment (descriptive stuff,
really, where a lot of info is needed).

Shorter comments use the rest-of-line form.

Since most of the comments I put in code are short (usually just to
describe what the next section does, if necessary, and typically are a
single line) they end up being mostly rest-of-line.

At work, with the autodoc system we use in Visual Studio, it requires
comment blocks which have 3 slashes ( /// ). Not a fan, but no choice
there either.

> Also, the “block” form allows “interspersed” comments, where a short
> comment can be put in the middle of a line and followed by more program
> text in the rest of the line. For example, as a way of keeping long
> argument lists straight:
>
> gdImageCopyResampled
> (
> /*dst =*/ ResizedFrame,
> /*src =*/ Context.StillFrame,
> /*dstX =*/ 0,
> /*dstY =*/ 0,
> /*srcX =*/ 0,
> /*srcY =*/ 0,
> /*dstW =*/ ResizedFrame->sx,
> /*dstH =*/ ResizedFrame->sy,
> /*srcW =*/ Context.StillFrame->sx,
> /*srcH =*/ Context.StillFrame->sy
> );

Ewww, no. That's a perfect case for end-of-line rest-of-line comments
after each line. Or refactoring the function signature somehow if
possible because that's a lot of parameters. Interspersed is just
messy-looking IMO. :)

One use for this though: if I'm making temporary changes to test
something out, I'll often comment out a bit of a line using /* .. */ but it's
solely for test purposes, and never ends up being committed.

Also some of this becomes moot anyway if a project has style guidelines,
not to mention automation in some editors (it's only more typing if the
editor doesn't autocomplete it for you).

--
Paul.

Re: Block Comments Or Rest-Of-Line Comments?

<v0haj0$3ujjm$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=35162&group=comp.lang.c#35162

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pau...@paulglover.net.invalid
Newsgroups: comp.lang.c
Subject: Re: Block Comments Or Rest-Of-Line Comments?
Date: Fri, 26 Apr 2024 22:41:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Sender: Paul Glover <paul@bsd.lan>
Message-ID: <v0haj0$3ujjm$2@dont-email.me>
References: <utgjh0$21nsq$2@dont-email.me> <uthj7e$29aoc$2@dont-email.me> <uthne5$2ad1b$1@dont-email.me> <87msqr1j8x.fsf@nosuchdomain.example.com> <5D0LN.84949$_a1e.79924@fx16.iad> <20240321133230.122@kylheku.com>
Injection-Date: Sat, 27 Apr 2024 00:41:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="96479a0e6d4a6889390c4a7ab23bc8c8";
logging-data="4148854"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hpXPbBjkuJ1D42r+O/zgcxDnD/RQF7OY="
User-Agent: tin/2.6.3-20231224 ("Banff") (FreeBSD/14.0-RELEASE (amd64))
Cancel-Lock: sha1:SMWiWxJOrN8KEe6+wpDjwNpt7tE=
 by: pau...@paulglover.net.invalid - Fri, 26 Apr 2024 22:41 UTC

Kaz Kylheku <433-929-6894@kylheku.com> wrote:
> I have a simpler approach: commits which introduced commented-out
> code, whether with #if 0, or any other means, shall not be merged.
>
> I don't perpetrate that in my open source projects, and "-1" such
> submissions at work.
>
> When someone wants to remove code, I encourage them to actually
> delete it. The comment about why it was deleted goes into the
> commit log.

Yes!! Every time a dev checks in dead code, $DEITY kills a small furry
creature out of spite.

Maybe it was appropriate 40 years ago before we had version control
systems, but we do now, and code deleted that needed to stay can easily
be brought back from the void. (I just had to do that in my day job, an
"unused" line which the IDE flagged actually was important and removing
it caused a runtime error. It was a 5 second fix when I could just pull
up the change details and pull the line back in.)

--
Paul.

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor