Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #77503 > unrolled thread

// comments and \

Started byBartC <bc@freeuk.com>
First post2015-12-01 12:52 +0000
Last post2015-12-01 12:24 -0800
Articles 20 on this page of 151 — 24 participants

Back to article view | Back to comp.lang.c


Contents

  // comments and \ BartC <bc@freeuk.com> - 2015-12-01 12:52 +0000
    Re: // comments and \ me <self@example.org> - 2015-12-01 13:08 +0000
      Re: // comments and \ Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-01 08:20 -0500
        Re: // comments and \ me <self@example.org> - 2015-12-01 13:36 +0000
          Re: // comments and \ Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-01 09:03 -0500
          Re: // comments and \ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-01 14:14 +0000
            Re: // comments and \ supercat@casperkitty.com - 2015-12-01 07:40 -0800
              Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 08:55 -0800
              Re: // comments and \ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-01 17:15 +0000
                Re: // comments and \ supercat@casperkitty.com - 2015-12-01 09:58 -0800
                  Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 18:11 +0000
                    Re: // comments and \ supercat@casperkitty.com - 2015-12-01 10:18 -0800
                      Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 18:20 +0000
                  Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 11:07 -0800
                    Re: // comments and \ supercat@casperkitty.com - 2015-12-01 11:39 -0800
                      Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 12:33 -0800
                    Re: // comments and \ glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-12-02 01:05 +0000
                  Re: // comments and \ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-01 19:30 +0000
              Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-01 20:59 +0100
                Re: // comments and \ James Kuyper <jameskuyper@verizon.net> - 2015-12-01 15:22 -0500
                Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 20:37 +0000
                  Re: // comments and \ Robert Wessel <robertwessel2@yahoo.com> - 2015-12-01 14:56 -0600
                    Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-01 22:11 +0100
                    Re: // comments and \ Philip Lantz <prl@canterey.us> - 2015-12-02 03:01 -0800
              Re: // comments and \ glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-12-02 00:45 +0000
          Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-01 07:52 -0700
            Re: // comments and \ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-01 15:19 +0000
              Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-01 08:29 -0700
                Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 15:35 +0000
                  Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-01 09:21 -0700
                    Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 16:41 +0000
                      Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-01 10:15 -0700
                        Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 17:24 +0000
                          Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 17:43 +0000
                          Re: // comments and \ Philip Lantz <prl@canterey.us> - 2015-12-02 03:05 -0800
                            Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-02 11:40 +0000
                              Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-02 04:29 -0800
                      Re: // comments and \ BartC <bc@freeuk.com> - 2015-12-01 19:11 +0000
                      Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-01 20:43 +0000
                        Re: // comments and \ BartC <bc@freeuk.com> - 2015-12-01 21:04 +0000
                          Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-01 21:16 +0000
                          Re: // comments and \ Philip Lantz <prl@canterey.us> - 2015-12-02 03:12 -0800
                            Re: // comments and \ BartC <bc@freeuk.com> - 2015-12-02 11:52 +0000
                              Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-02 04:40 -0800
                              Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-02 13:55 +0100
                                Re: // comments and \ BartC <bc@freeuk.com> - 2015-12-02 13:56 +0000
                                  Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-02 15:24 +0100
                                    Re: // comments and \ supercat@casperkitty.com - 2015-12-02 06:54 -0800
                                      Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-02 16:40 +0100
                                Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-02 18:24 +0000
                                  Re: // comments and \ Öö Tiib <ootiib@hot.ee> - 2015-12-02 20:27 -0800
                                    Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-02 23:22 -0800
                                      Re: // comments and \ Öö Tiib <ootiib@hot.ee> - 2015-12-03 00:57 -0800
                                        Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-03 23:44 +0000
                                          Re: // comments and \ Öö Tiib <ootiib@hot.ee> - 2015-12-03 21:17 -0800
                                            Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-05 00:43 +0000
                                              Re: // comments and \ Les Cargill <lcargill99@comcast.com> - 2015-12-04 20:32 -0600
                                                Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-05 16:06 +0000
                                                  Re: // comments and \ Les Cargill <lcargill99@comcast.com> - 2015-12-05 13:10 -0600
                                                    Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-06 10:18 +0000
                                                      Re: // comments and \ Les Cargill <lcargill99@comcast.com> - 2015-12-06 14:26 -0600
                                  Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-03 12:45 +0100
                                    Re: // comments and \ raltbos@xs4all.nl (Richard Bos) - 2015-12-04 11:45 +0000
                                      Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-04 04:20 -0800
                                      Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-04 14:20 +0100
                                      Re: // comments and \ James Kuyper <jameskuyper@verizon.net> - 2015-12-04 10:05 -0500
                                        Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-04 17:31 +0100
                                        Re: // comments and \ Les Cargill <lcargill99@comcast.com> - 2015-12-04 17:24 -0600
                                          Re: // comments and \ James Kuyper <jameskuyper@verizon.net> - 2015-12-04 18:50 -0500
                                            Re: // comments and \ Les Cargill <lcargill99@comcast.com> - 2015-12-04 20:34 -0600
                                        Re: // comments and \ raltbos@xs4all.nl (Richard Bos) - 2015-12-10 20:40 +0000
                                      Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-04 09:36 -0800
                                      Re: // comments and \ Richard Damon <Richard@Damon-Family.org> - 2015-12-05 09:05 -0500
                                      Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-05 17:42 +0000
                                        Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-06 22:23 +0100
                                          Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-07 21:59 +0000
                                    Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-05 15:50 +0000
                                      Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-05 18:17 +0100
                                        Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-06 10:01 +0000
                                          Re: // comments and \ Öö Tiib <ootiib@hot.ee> - 2015-12-06 03:05 -0800
                                            Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-06 04:07 -0800
                                              Re: // comments and \ Öö Tiib <ootiib@hot.ee> - 2015-12-06 04:37 -0800
                                                Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-06 05:05 -0800
                                                  Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-06 12:19 -0800
                                            Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-06 13:59 +0000
                                              Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-06 06:09 -0800
                                                Re: // comments and \ Öö Tiib <ootiib@hot.ee> - 2015-12-06 07:30 -0800
                                                  Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-06 18:55 +0000
                                                Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-06 12:23 -0800
                                              Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-06 12:22 -0800
                                                Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-06 21:06 +0000
                                      Re: // comments and \ Les Cargill <lcargill99@comcast.com> - 2015-12-05 13:14 -0600
                                        Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-06 10:09 +0000
                                  Re: // comments and \ mark.bluemel@gmail.com - 2015-12-03 06:15 -0800
                            Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-02 08:28 -0700
                              Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-02 09:01 -0800
                                Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-02 21:52 +0000
                                  Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-02 16:55 -0800
                                    Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-03 13:11 +0100
                                      Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-03 23:21 +0000
                                        Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-04 11:22 +0100
                                          Re: // comments and \ Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-12-05 01:12 +0000
                                            Re: // comments and \ Les Cargill <lcargill99@comcast.com> - 2015-12-04 20:39 -0600
                      Re: // comments and \ raltbos@xs4all.nl (Richard Bos) - 2015-12-04 11:14 +0000
                        Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-04 12:25 +0000
                        Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-04 14:23 +0100
                    Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 09:00 -0800
                  Re: // comments and \ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-01 19:46 +0000
                    Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 20:36 +0000
                  Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-01 20:37 -0700
    Re: // comments and \ BartC <bc@freeuk.com> - 2015-12-01 14:26 +0000
      Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 14:32 +0000
      Re: // comments and \ BartC <bc@freeuk.com> - 2015-12-01 14:52 +0000
        Re: // comments and \ David Brown <david.brown@hesbynett.no> - 2015-12-01 16:15 +0100
        Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 15:28 +0000
          Re: // comments and \ glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-12-02 01:26 +0000
        Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 09:12 -0800
          Re: // comments and \ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-12-01 19:17 +0000
        Re: // comments and \ Robert Wessel <robertwessel2@yahoo.com> - 2015-12-01 12:32 -0600
      Re: // comments and \ Nobody <nobody@nowhere.invalid> - 2015-12-02 00:01 +0000
        Re: // comments and \ supercat@casperkitty.com - 2015-12-02 07:08 -0800
          Re: // comments and \ Nobody <nobody@nowhere.invalid> - 2015-12-02 21:05 +0000
            Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-02 14:22 -0800
            Re: // comments and \ supercat@casperkitty.com - 2015-12-02 14:48 -0800
              Re: // comments and \ glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-12-02 23:37 +0000
                Re: // comments and \ supercat@casperkitty.com - 2015-12-02 17:10 -0800
                  Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-02 19:24 -0800
                    Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-03 04:10 +0000
                      Re: // comments and \ Philip Lantz <prl@canterey.us> - 2015-12-02 21:49 -0800
                        Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-03 07:28 -0700
                      Re: // comments and \ supercat@casperkitty.com - 2015-12-03 09:12 -0800
                    Re: // comments and \ supercat@casperkitty.com - 2015-12-03 06:53 -0800
                    Re: // comments and \ supercat@casperkitty.com - 2015-12-03 15:41 -0800
                      Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-03 15:56 -0800
                        Re: // comments and \ supercat@casperkitty.com - 2015-12-03 16:44 -0800
                          Re: // comments and \ Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-12-03 17:29 -0800
                            Re: // comments and \ supercat@casperkitty.com - 2015-12-03 19:10 -0800
          Re: // comments and \ Philip Lantz <prl@canterey.us> - 2015-12-02 21:59 -0800
    Re: // comments and \ Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-12-01 07:52 -0700
    Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 09:21 -0800
      Re: // comments and \ Richard Heathfield <rjh@cpax.org.uk> - 2015-12-01 17:26 +0000
        Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 10:50 -0800
      Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-01 10:49 -0800
        Re: // comments and \ Geoff <geoff@invalid.invalid> - 2015-12-01 11:34 -0800
      Re: // comments and \ David Thompson <dave.thompson2@verizon.net> - 2015-12-22 06:44 -0500
        Re: // comments and \ "Charles Richmond" <numerist@aquaporin4.com> - 2015-12-23 14:35 -0600
          Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-23 13:00 -0800
            Re: // comments and \ James Kuyper <jameskuyper@verizon.net> - 2015-12-23 16:58 -0500
              Re: // comments and \ Keith Thompson <kst-u@mib.org> - 2015-12-23 14:21 -0800
          Re: // comments and \ James Kuyper <jameskuyper@verizon.net> - 2015-12-23 16:55 -0500
    Re: // comments and \ Öö Tiib <ootiib@hot.ee> - 2015-12-01 12:24 -0800

Page 2 of 8 — ← Prev page 1 [2] 3 4 5 6 7 8  Next page →


#77566

FromRichard Heathfield <rjh@cpax.org.uk>
Date2015-12-01 20:37 +0000
Message-ID<n3l0aj$t5i$2@dont-email.me>
In reply to#77555
On 01/12/15 19:59, David Brown wrote:

<snip>

> // comments were not "an entirely new concept" when introduced to C.
> They were copied directly from C++,

Not from BCPL, then?

<snip>

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#77570

FromRobert Wessel <robertwessel2@yahoo.com>
Date2015-12-01 14:56 -0600
Message-ID<s92s5bhlaobt4cvq5641m02r4j8obqntud@4ax.com>
In reply to#77566
On Tue, 1 Dec 2015 20:37:56 +0000, Richard Heathfield
<rjh@cpax.org.uk> wrote:

>On 01/12/15 19:59, David Brown wrote:
>
><snip>
>
>> // comments were not "an entirely new concept" when introduced to C.
>> They were copied directly from C++,
>
>Not from BCPL, then?


C++ copied // comments from BCPL, C copied them from C++.

[toc] | [prev] | [next] | [standalone]


#77572

FromDavid Brown <david.brown@hesbynett.no>
Date2015-12-01 22:11 +0100
Message-ID<n3l28u$512$1@dont-email.me>
In reply to#77570
On 01/12/15 21:56, Robert Wessel wrote:
> On Tue, 1 Dec 2015 20:37:56 +0000, Richard Heathfield
> <rjh@cpax.org.uk> wrote:
>
>> On 01/12/15 19:59, David Brown wrote:
>>
>> <snip>
>>
>>> // comments were not "an entirely new concept" when introduced to C.
>>> They were copied directly from C++,
>>
>> Not from BCPL, then?
>
>
> C++ copied // comments from BCPL, C copied them from C++.
>

Indeed.  In particular, I don't think BCPL had backslash line splicing 
(though I have only /very/ limited knowledge of the language), so C 
would have to match the // \ behaviour with C++.

[toc] | [prev] | [next] | [standalone]


#77601

FromPhilip Lantz <prl@canterey.us>
Date2015-12-02 03:01 -0800
Message-ID<MPG.30c86f765f990af3b8@news.eternal-september.org>
In reply to#77570
Robert Wessel wrote:
> Richard Heathfield wrote:
> >> // comments were not "an entirely new concept" when introduced to C.
> >> They were copied directly from C++,
> >
> >Not from BCPL, then?
> 
> C++ copied // comments from BCPL, C copied them from C++.

Apparently I've spent far too much of my life coding in C,
since I read this as "C++ copied" and wondered where the rest
of the sentence was.

[toc] | [prev] | [next] | [standalone]


#77586

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2015-12-02 00:45 +0000
Message-ID<n3leuv$ku7$1@speranza.aioe.org>
In reply to#77523
supercat@casperkitty.com wrote:
> On Tuesday, December 1, 2015 at 8:14:46 AM UTC-6, Ben Bacarisse wrote:
>> It's a consequence of adding // comments into C in 1999 along with the
>> principle of least surprise.  Ever since ANSI C in 1989 (and probably
>> earlier in some implementations) a newline preceded by a \ are ignored.
>> This was always permitted in C #define lines, but ANSI C made it a
>> general line-continuation mechanism to be performed before almost
>> anything else, and just before comment removal.  Thus, when // comments
>> were added, the current behaviour was the least surprising -- certainly
>> the behaviour that needed the fewest special-case changes to the
>> existing words.
 
> I don't know about that--since "//" comments are an entirely new concept,
> they could just as well have been defined as being handled before anything
> else.  If anything, doing that would have made it easier to adapt existing
> compiler systems, since all one would need to do is filter the source files
> through a utility that strips "//" comments and feed the result into an
> existing compiler, rather than having to handle "//" between pre-processing
> steps.

They could have, but then other things happen:

char *s="This is a long string \
// that contains some pairs of \
slashes//";

Since they // are inside a string, they are not comments.

-- glen

[toc] | [prev] | [next] | [standalone]


#77516

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2015-12-01 07:52 -0700
Message-ID<1by4dedxvd.fsf@pfeifferfamily.net>
In reply to#77507
me <self@example.org> writes:

> On 2015-12-01, Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
>>> I never head of this. What compiler are you using?
>>      One that follows the C Standard, in this regard at least.
>
> Crazy! I never heard of this. But I believe you! I guess that's kind of an
> unusual way of commenting. You don't see it often.
>
> Thanks for sharing, pals.

I see (and use) it a lot more often than I do /* */ comments these
days.

[toc] | [prev] | [next] | [standalone]


#77519

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2015-12-01 15:19 +0000
Message-ID<874mg2dwm9.fsf@bsb.me.uk>
In reply to#77516
Joe Pfeiffer <pfeiffer@cs.nmsu.edu> writes:

> me <self@example.org> writes:
>
>> On 2015-12-01, Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
>>>> I never head of this. What compiler are you using?
>>>      One that follows the C Standard, in this regard at least.
>>
>> Crazy! I never heard of this. But I believe you! I guess that's kind of an
>> unusual way of commenting. You don't see it often.
>>
>> Thanks for sharing, pals.
>
> I see (and use) it a lot more often than I do /* */ comments these
> days.

By which you mean // comments, of course.  And (to clarify) when I said
that "me" should never see that kind of comment I meant a continued //
comments.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#77521

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2015-12-01 08:29 -0700
Message-ID<1btwo2dw6b.fsf@pfeifferfamily.net>
In reply to#77519
Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Joe Pfeiffer <pfeiffer@cs.nmsu.edu> writes:
>
>> me <self@example.org> writes:
>>
>>> On 2015-12-01, Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
>>>>> I never head of this. What compiler are you using?
>>>>      One that follows the C Standard, in this regard at least.
>>>
>>> Crazy! I never heard of this. But I believe you! I guess that's kind of an
>>> unusual way of commenting. You don't see it often.
>>>
>>> Thanks for sharing, pals.
>>
>> I see (and use) it a lot more often than I do /* */ comments these
>> days.
>
> By which you mean // comments, of course.  And (to clarify) when I said
> that "me" should never see that kind of comment I meant a continued //
> comments.

Ah, OK.  I misunderstood.  You're right, I don't think I've *ever* seen
a continued // comment before this thread.

[toc] | [prev] | [next] | [standalone]


#77522

FromRichard Heathfield <rjh@cpax.org.uk>
Date2015-12-01 15:35 +0000
Message-ID<n3keip$itf$1@dont-email.me>
In reply to#77521
On 01/12/15 15:29, Joe Pfeiffer wrote:
> [...]  I don't think I've *ever* seen
> a continued // comment before this thread.

I first heard of it in about 1991/2, in C++ rather than C. The product 
was Oracle Data Query, and the problem code looked something like this:

   foo(path); // for unit testing, use c:\odq\dev\ut\foo\
   bar();
   baz();

and the code jumped straight from foo() to baz() without ever entering 
bar(). It took a *long* time to spot the problem, after which the house 
style guidelines were amended to outlaw // comments. (I doubt very much 
whether that is still the case, though. For some reason, // comments are 
enormously popular.)

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#77525

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2015-12-01 09:21 -0700
Message-ID<1bh9k2dtri.fsf@pfeifferfamily.net>
In reply to#77522
Richard Heathfield <rjh@cpax.org.uk> writes:

> On 01/12/15 15:29, Joe Pfeiffer wrote:
>> [...]  I don't think I've *ever* seen
>> a continued // comment before this thread.
>
> I first heard of it in about 1991/2, in C++ rather than C. The product
> was Oracle Data Query, and the problem code looked something like
> this:
>
>   foo(path); // for unit testing, use c:\odq\dev\ut\foo\
>   bar();
>   baz();
>
> and the code jumped straight from foo() to baz() without ever entering
> bar(). It took a *long* time to spot the problem, after which the
> house style guidelines were amended to outlaw // comments. (I doubt
> very much whether that is still the case, though. For some reason, //
> comments are enormously popular.)

I like them for two reasons --

I don't have to look for the end of a comment block.  It's just a block
of //

If I'm in the throes of debugging I can comment out a bunch of code with
/* */ without a comment throwing in a monkey wrench.

[toc] | [prev] | [next] | [standalone]


#77527

FromRichard Heathfield <rjh@cpax.org.uk>
Date2015-12-01 16:41 +0000
Message-ID<n3kig7$2bg$1@dont-email.me>
In reply to#77525
On 01/12/15 16:21, Joe Pfeiffer wrote:
>
> I like [ // comments ] for two reasons --
>
> I don't have to look for the end of a comment block.  It's just a block
> of //

Syntax colouring? :-)

>
> If I'm in the throes of debugging I can comment out a bunch of code with
> /* */ without a comment throwing in a monkey wrench.

#if 0

#endif

/* */ is for comments, not code.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#77531

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2015-12-01 10:15 -0700
Message-ID<1bd1uqdr9q.fsf@pfeifferfamily.net>
In reply to#77527
Richard Heathfield <rjh@cpax.org.uk> writes:

> On 01/12/15 16:21, Joe Pfeiffer wrote:
>>
>> I like [ // comments ] for two reasons --
>>
>> I don't have to look for the end of a comment block.  It's just a block
>> of //
>
> Syntax colouring? :-)

I *hate* syntax coloring.  I've never seen a set of colors selected that
I didn't find distracting, and most of the sets I've seen have done
things like use yellow on white background...

>>
>> If I'm in the throes of debugging I can comment out a bunch of code with
>> /* */ without a comment throwing in a monkey wrench.
>
> #if 0
>
> #endif
>
> /* */ is for comments, not code.

[toc] | [prev] | [next] | [standalone]


#77534

FromRichard Heathfield <rjh@cpax.org.uk>
Date2015-12-01 17:24 +0000
Message-ID<n3kl09$dhn$1@dont-email.me>
In reply to#77531
On 01/12/15 17:15, Joe Pfeiffer wrote:
> Richard Heathfield <rjh@cpax.org.uk> writes:
>
>> On 01/12/15 16:21, Joe Pfeiffer wrote:
>>>
>>> I like [ // comments ] for two reasons --
>>>
>>> I don't have to look for the end of a comment block.  It's just a block
>>> of //
>>
>> Syntax colouring? :-)
>
> I *hate* syntax coloring.  I've never seen a set of colors selected that
> I didn't find distracting, and most of the sets I've seen have done
> things like use yellow on white background...

Personally I like syntax colouring, but I hate default colour schemes as 
much as you do, which is why the colour scheme is one of the first 
things I set up when installing a new editor or IDE. I do it once, it 
takes ten minutes tops, and then it's done forever on that machine. (For 
some editors, I need only copy the config file from another box, which 
is even quicker.)

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#77537

FromRichard Heathfield <rjh@cpax.org.uk>
Date2015-12-01 17:43 +0000
Message-ID<n3km2t$hjm$1@dont-email.me>
In reply to#77534
On 01/12/15 17:37, Stefan Ram wrote:
> Richard Heathfield <rjh@cpax.org.uk> writes:
>> Personally I like syntax colouring, but I hate default colour schemes as
>
>    I had a new IDE for C and C++ with syntax coloring, so I set
>    all colors to black. I observed that there still was some
>    styling: All keywords were bold. I left it as it was.
>
>    Two weeks later, I observed that it makes the variable name
>    »this« bold in my C programs.

I've seen that too, although I can't now remember where. It is 
relatively harmless, though - I was more annoyed by Visual Studio's // 
comment in <math.h>, which gave me a level 4 warning on *every* 
compilation that included that header. (I haven't kept up to date with 
Visual Studio, so I don't know whether it's still a problem.)

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#77602

FromPhilip Lantz <prl@canterey.us>
Date2015-12-02 03:05 -0800
Message-ID<MPG.30c8704c984a6fedb9@news.eternal-september.org>
In reply to#77534
Richard Heathfield wrote:
> Joe Pfeiffer wrote:
> > Richard Heathfield writes:
> >> Joe Pfeiffer wrote:
> >>>
> >>> I like [ // comments ] for two reasons --
> >>>
> >>> I don't have to look for the end of a comment block.  It's just a block
> >>> of //
> >>
> >> Syntax colouring? :-)
> >
> > I *hate* syntax coloring.  I've never seen a set of colors selected that
> > I didn't find distracting, and most of the sets I've seen have done
> > things like use yellow on white background...
> 
> Personally I like syntax colouring, but I hate default colour schemes as 
> much as you do, which is why the colour scheme is one of the first 
> things I set up when installing a new editor or IDE. I do it once, it 
> takes ten minutes tops, and then it's done forever on that machine. (For 
> some editors, I need only copy the config file from another box, which 
> is even quicker.)

Can you share your color choices? (In general terms, I don't need every
last detail.) I've never seen one I could stand.

[toc] | [prev] | [next] | [standalone]


#77604

FromRichard Heathfield <rjh@cpax.org.uk>
Date2015-12-02 11:40 +0000
Message-ID<n3ml75$424$1@dont-email.me>
In reply to#77602
On 02/12/15 11:05, Philip Lantz wrote:
> Richard Heathfield wrote:

<snip>

>> Personally I like syntax colouring, but I hate default colour schemes as
>> much as you do, which is why the colour scheme is one of the first
>> things I set up when installing a new editor or IDE. I do it once, it
>> takes ten minutes tops, and then it's done forever on that machine. (For
>> some editors, I need only copy the config file from another box, which
>> is even quicker.)
>
> Can you share your color choices? (In general terms, I don't need every
> last detail.) I've never seen one I could stand.

Default: black background, bold green foreground. (This is mostly for 
historical reasons - I cut my teeth on Trend DT-22s - but it's also 
because I find it clear, non-glary, and relaxing.)

Keywords: cyan.
Operators: cyan.
Literals: white.
Comments: yellow.

I never did get the hang of subtlety. :-)

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#77609

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2015-12-02 04:29 -0800
Message-ID<9f56c53b-5578-43b6-8ff5-00dc3436b758@googlegroups.com>
In reply to#77604
On Wednesday, December 2, 2015 at 11:40:55 AM UTC, Richard Heathfield wrote:
> On 02/12/15 11:05, Philip Lantz wrote:
> 
> > Can you share your color choices? (In general terms, I don't need every
> > last detail.) I've never seen one I could stand.
> 
> Default: black background, bold green foreground. (This is mostly for 
> historical reasons - I cut my teeth on Trend DT-22s - but it's also 
> because I find it clear, non-glary, and relaxing.)
> 
> Keywords: cyan.
> Operators: cyan.
> Literals: white.
> Comments: yellow.
> 
> I never did get the hang of subtlety. :-)
> 
I find the most useful is green for comments and red/brown for string literals.
That's because of the fact that you can stringise or comment out text
which otherwise would be code.
Blue keywords don't do any harm, but in C you know the keywords,
and functions can't be mistaken for anything except function pointers
(so I always use the (*fptr)(args); syntax to make clear that it's an indirect
call).

[toc] | [prev] | [next] | [standalone]


#77549

FromBartC <bc@freeuk.com>
Date2015-12-01 19:11 +0000
Message-ID<n3kr7s$86b$1@dont-email.me>
In reply to#77527
On 01/12/2015 16:41, Richard Heathfield wrote:
> On 01/12/15 16:21, Joe Pfeiffer wrote:
>>
>> I like [ // comments ] for two reasons --
>>
>> I don't have to look for the end of a comment block.  It's just a block
>> of //
>
> Syntax colouring? :-)

The editor needs to know the rules.

My editor will highlight // comments up to the end of the line, or 
rather de-highlight them so they don't obtrude on the code. But it 
doesn't know about the trailing \ quirk so the next line appears normal 
and making it even harder to debug.

The other revelation about how \ actually works means my editor's syntax 
colouring cannot work correctly in general, as it only looks at complete 
tokens in a given line.

But there could be a very long identifier or literal, split up over 
hundred of lines with \, with the editor displaying the middle part. So 
not only does it need to follow a forward chain of \s hundreds of lines 
long, but it needs to search backwards too (so that it can establish 
whether it's a keyword, identifier, number or string).

It's really not worth the candle.

(BTW the Nasm assembler where I first saw the //...\ problem (as ; ... \ 
in its syntax), also does C's thing with being to split tokens across 
lines with \. I don't believe it's a coincidence!)

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#77568

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2015-12-01 20:43 +0000
Message-ID<slrnn5s1j0.5q5.grahn+nntp@frailea.sa.invalid>
In reply to#77527
On Tue, 2015-12-01, Richard Heathfield wrote:
> On 01/12/15 16:21, Joe Pfeiffer wrote:
>>
>> I like [ // comments ] for two reasons --
>>
>> I don't have to look for the end of a comment block.  It's just a block
>> of //
>
> Syntax colouring? :-)
>
>>
>> If I'm in the throes of debugging I can comment out a bunch of code with
>> /* */ without a comment throwing in a monkey wrench.
>
> #if 0
>
> #endif

Or often better, use the version control system and just delete the
code.

> /* */ is for comments, not code.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#77571

FromBartC <bc@freeuk.com>
Date2015-12-01 21:04 +0000
Message-ID<n3l1rv$47l$1@dont-email.me>
In reply to#77568
On 01/12/2015 20:43, Jorgen Grahn wrote:
> On Tue, 2015-12-01, Richard Heathfield wrote:
>> On 01/12/15 16:21, Joe Pfeiffer wrote:
>>>
>>> I like [ // comments ] for two reasons --
>>>
>>> I don't have to look for the end of a comment block.  It's just a block
>>> of //
>>
>> Syntax colouring? :-)
>>
>>>
>>> If I'm in the throes of debugging I can comment out a bunch of code with
>>> /* */ without a comment throwing in a monkey wrench.
>>
>> #if 0
>>
>> #endif
>
> Or often better, use the version control system and just delete the
> code.

Better? I comment and uncomment lines /all the time/ while developing 
code, sometimes several times a minute. I use single-key commands in my 
editor to instantly comment/uncomment the current line then move on to 
the next. With key repeat it can do blocks of code at 20 lines per 
second. Commented blocks can be nested.

I can compare commented/uncommented lines instantly. One common use is 
to comment out the real code and use temporary test code to try 
something new; I don't want to delete working code!

How long would a version system take to do that with trivial blocks of 
code? Apart which which, I might in the middle move on to work on 
another part of the application, then come back to this bit. How to undo 
the obvious comments without undoing anything else?

(I've never used version control but it sounds like a very big 
sledgehammer to for what we're talking about. Using #if 0 is just a 
standard hammer for the same job!)

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


Page 2 of 8 — ← Prev page 1 [2] 3 4 5 6 7 8  Next page →

Back to top | Article view | comp.lang.c


csiph-web