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


Groups > comp.lang.c > #140504

Re: Didactic "white lies"

From "Pascal J. Bourguignon" <pjb@informatimago.com>
Newsgroups comp.lang.c
Subject Re: Didactic "white lies"
Date 2019-02-03 23:40 +0100
Organization Informatimago
Message-ID <m2va20qywh.fsf@despina.home> (permalink)
References <lies-20190203151329@ram.dialup.fu-berlin.de> <lnsgx4vbuu.fsf@kst-u.example.com>

Show all headers | View raw


Keith Thompson <kst-u@mib.org> writes:

> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>   One white lie I tell at the beginning of my C course, when
>>   the proper treatment of pointers still is in a remote distance:
>>
>>   To explain »char *«: »char« means "character", and the »*«
>>   means the preceding thing can be repeated arbitrarily often,
>>   so »char *« means "a sequence of characters". - Explanation 
>>   without the need to speak of anything that was not treated yet.
>>
>>   The truth in that lie is: When you follow a »char *« you 
>>   are usually supposed to find any number of character
>>   objects there. (Though I'm not sure what to make of the
>>   special case of 0 characters. Well, we can »malloc(0)«,
>>   so why not?)
>
> By telling this "white" lie, you help perpetuate the confusion about
> the relationship between arrays and pointers in C.  I've had to
> (well, I've chosen to) spend way too much time clearing up this
> confusion, usually with a reference to section 6 of the comp.lang.c
> FAQ.
>
> If you don't want to explain pointers yet, you can show some examples
> of pointer syntax and say that the details will be explained later.
> (And I'll bet some of your students will want to find out how
> pointers really mean before the course gets to it.)
>
> At what point in the course can your students safely assume that
> you're no longer lying to them?

I'm sorry to say that I never understood the problem.  It's true that I
learned pointers in Pascal.  Perhaps you should teach Pascal as an
introduction to C programming?

-- 
__Pascal J. Bourguignon__
http://www.informatimago.com

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


Thread

Re: Didactic "white lies" Keith Thompson <kst-u@mib.org> - 2019-02-03 12:46 -0800
  Re: Didactic "white lies" "Pascal J. Bourguignon" <pjb@informatimago.com> - 2019-02-03 23:40 +0100
  Re: Didactic "white lies" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-02-04 03:35 -0800
    Re: Didactic "white lies" Keith Thompson <kst-u@mib.org> - 2019-02-04 12:01 -0800
    Re: Didactic "white lies" James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-02-04 12:33 -0800
      Re: Didactic "white lies" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-02-05 01:37 -0800
        Re: Didactic "white lies" Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2019-02-05 08:56 -0700
          Re: Didactic "white lies" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-02-05 08:03 -0800
            Re: Didactic "white lies" scott@slp53.sl.home (Scott Lurndal) - 2019-02-05 16:39 +0000
            Re: Didactic "white lies" James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-02-05 10:35 -0800
              Re: Didactic "white lies" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-02-05 12:34 -0800
        Re: Didactic "white lies" James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-02-05 10:31 -0800
    Re: Didactic "white lies" John Bode <jfbode1029@gmail.com> - 2019-02-05 08:55 -0800

csiph-web