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


Groups > comp.lang.c > #102965

Re: while loop condition doesn't work

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: while loop condition doesn't work
Date Thu, 02 Feb 2017 10:01:55 -0800
Organization None to speak of
Lines 72
Message-ID <lninos79po.fsf@kst-u.example.com> (permalink)
References <750784a4-22dc-44ef-8972-34d4fb048b00@googlegroups.com> <871svxdiu9.fsf@bsb.me.uk> <e9b02777-9542-4e5b-bbf7-885c9bbcb5da@googlegroups.com> <87pojhbw2h.fsf@bsb.me.uk> <d4616907-128c-442d-b29e-82bf47b4e83d@googlegroups.com> <o5tcfb$ap3$1@dont-email.me> <o5tf8a$lpn$1@dont-email.me> <o5tfrf$o7q$1@dont-email.me> <kfnbmuoff0p.fsf@x-alumni2.alumni.caltech.edu> <ln37g09p3k.fsf@kst-u.example.com> <kfnwpd9b1kq.fsf@x-alumni2.alumni.caltech.edu>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="523b5027be519a02b651eac1ee0346e8"; logging-data="28089"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JOoUVFkvevvlMDApnrvcG"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:xCztJ4GRkZpldxOjKHcw3PQudo0= sha1:JmqrjIfqZK43yAaGGecpi9kvg8Y=
Xref csiph.com comp.lang.c:102965

Show key headers only | View raw


Tim Rentsch <txr@alumni.caltech.edu> writes:
> Keith Thompson <kst-u@mib.org> writes:
[...]
>> I agree that there's a problem.  I'm not sure eliminating such
>> comments or moving them elsewhere is the best solution.
>
> How you phrase the statement shows how deep the problem is.  My
> suggestion is not to move /comments/ but to put /commentary/
> outside the program.  Any program examples that have /comments/
> should have only those comments that one would write as part
> of a real (as opposed to example or tutorial) program.

In your opinion.

>                                                         The
> question of what is the best solution is misplaced:  it assumes
> we know exactly what problem we're trying to solve, that it is
> well-defined, that there is a "best" solution (by what metric?),
> and that we could tell whether a proposed solution is a best
> solution.  My goal is to avoid a behavior fairly well known to
> have negative effects.  It may be that in the process of doing
> that there will be other unexpected effects, but the only way
> to know what those might be is to try the suggestion and see
> what happens.

The goal is to present code to novice student programmers and explain to
them what the constructs in it mean.  Including comments explaining, for
example, what "++" means is one solution to that problem.  As discussed,
that solution causes another problem, encouraging the inappropriate use
of similar comments when the audience is not novice student programmers.

I suggest that clearly marking such comments and explaining their
purpose is one possible solution to that secondary problem.

[...]

>> Perhaps one could use some special marker, with a comment at the
>> top (and an explanation by the instructor) saying that any marked
>> comments are intended to explain the language features and should
>> not be included in real code.
>>
>>     int i;  /* TUT:  Create an object named "i" of type int */
>>     i = 42; /* TUT:  Assign the value 42 to i */
>>     i ++;   /* TUT:  Increment i by 1 */
>
> I've seen this done in other ways (eg, using a different font
> for the non-code material).  It suffers from many of the same
> problems that regular comments do.  Most importantly, it too
> promotes or reinforces a way of thinking that is damaging to
> less experienced programmers.  In that respect it isn't really
> an improvement over using regular "comments".

It's specifically intended to emphasize the point that such comments are
for exposition to inexperienced programmers, and that such comments
should not be used when such programmers are not the intended audience.

If you think it wouldn't work, that's fine; you may be right.

>> (It's been a long time since I was a beginning programmer, so
>> it's hard for me to tell what would work best.)
>
> The "what would work best" phrase tacitly implies that you
> know what problem is being addressed.  Can you say what problem
> it is you're trying to solve here?

See above.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 01:24 -0800
  Re: while loop condition doesn't work mark.bluemel@gmail.com - 2017-01-20 03:29 -0800
  Re: while loop condition doesn't work Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-20 12:19 +0000
    Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 05:12 -0800
      Re: while loop condition doesn't work Richard Heathfield <rjh@cpax.org.uk> - 2017-01-20 13:17 +0000
        Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 05:20 -0800
        Re: while loop condition doesn't work Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-20 15:07 +0000
    Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 05:31 -0800
      Re: while loop condition doesn't work Manfred <noname@invalid.add> - 2017-01-20 15:23 +0100
      Re: while loop condition doesn't work Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-20 15:16 +0000
        Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 07:45 -0800
          Re: while loop condition doesn't work Richard Heathfield <rjh@cpax.org.uk> - 2017-01-20 16:06 +0000
            Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 08:37 -0800
            Re: while loop condition doesn't work David Brown <david.brown@hesbynett.no> - 2017-01-20 17:54 +0100
              Re: while loop condition doesn't work Richard Heathfield <rjh@cpax.org.uk> - 2017-01-20 17:04 +0000
                Re: while loop condition doesn't work David Brown <david.brown@hesbynett.no> - 2017-01-20 19:08 +0100
                Re: while loop condition doesn't work Tim Rentsch <txr@alumni.caltech.edu> - 2017-01-30 12:51 -0800
                Re: while loop condition doesn't work Keith Thompson <kst-u@mib.org> - 2017-01-30 14:09 -0800
                Re: while loop condition doesn't work supercat@casperkitty.com - 2017-01-30 14:57 -0800
                Re: while loop condition doesn't work Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-01 21:31 -0800
                Re: while loop condition doesn't work Keith Thompson <kst-u@mib.org> - 2017-02-02 10:01 -0800
                Re: while loop condition doesn't work Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-04 00:22 -0800
              Re: while loop condition doesn't work Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-20 19:12 +0000
                Re: while loop condition doesn't work Richard Heathfield <rjh@cpax.org.uk> - 2017-01-23 10:54 +0000
            Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 23:22 -0800
              Re: while loop condition doesn't work Richard Heathfield <rjh@cpax.org.uk> - 2017-01-23 11:02 +0000
            Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-21 01:22 -0800
              Re: while loop condition doesn't work Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-21 11:00 +0000
                Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-21 08:35 -0800
                Re: while loop condition doesn't work Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-21 17:17 +0000
                Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-21 09:32 -0800
          Re: while loop condition doesn't work Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-20 19:16 +0000
            Re: while loop condition doesn't work Richard Heathfield <rjh@cpax.org.uk> - 2017-01-23 11:03 +0000
    Re: while loop condition doesn't work David Brown <david.brown@hesbynett.no> - 2017-01-20 14:34 +0100
      Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 07:40 -0800
        Re: while loop condition doesn't work Richard Heathfield <rjh@cpax.org.uk> - 2017-01-20 15:47 +0000
          Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 08:26 -0800
            Re: while loop condition doesn't work David Brown <david.brown@hesbynett.no> - 2017-01-20 18:01 +0100
              Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 09:26 -0800
                Re: while loop condition doesn't work David Brown <david.brown@hesbynett.no> - 2017-01-20 19:02 +0100
                Re: while loop condition doesn't work Alla _ <modelling.data@gmail.com> - 2017-01-20 10:13 -0800
                Re: while loop condition doesn't work Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-01-21 05:36 -0800

csiph-web