home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 12878 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.9 KB

  1. Path: sparky!uunet!decwrl!concert!duke!trt
  2. From: trt@duke.cs.duke.edu (Tom Truscott)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Most difficult part of learning C?
  5. Message-ID: <714939390@romeo.cs.duke.edu>
  6. Date: 27 Aug 92 18:16:31 GMT
  7. References: <9208251159.AA04122@ult4> <1992Aug26.103256.5267@itnsg1.cineca.it> <drice.714872469@ponder>
  8. Distribution: usa
  9. Organization: IBM RTP
  10. Lines: 36
  11.  
  12. >>I am conducting research for a little project concerning difficulties in
  13. >>learning C and how to improve the teaching of C so as to circumvent these
  14. >>problems.
  15.  
  16. The biggest difficulty in learning C that I have encountered
  17. is the lack of a hand-holding coding&testing environment.
  18. There exist such environments (e.g. CodeCenter), but they are still rare.
  19. I once taught a course using Pascal rather than C because
  20. the available Berkeley Pascal interpreter ("pix") was
  21. far more error-friendly than the available C compiler ("cc").
  22.  
  23. A difficulty I have not seen mentioned is in learning how
  24. to use the boolean operators & | ^ ~.  These are not used that much
  25. in other languages, which is probably why some students are bewildered.
  26.  
  27. Some difficulties can be circumvented by avoiding them entirely.
  28. In my opinion the following can be omitted:
  29.     boolean operators
  30.     when teaching && and || warn of the need to "double"
  31.     goto
  32.     I ignore it entirely unless someone brings it up
  33.     enumerated types
  34.     bit fields
  35.     typedefs
  36.     unions
  37.     pointer arithmetic
  38.     C pointers can be taught as easily as Pascal pointers.
  39.     Just teach the "Pascal subset" (no pointer arithmetic).
  40.     Don't teach them "while (*dst++ = *src++)  ;",
  41.     teach them "for (i = 0; (dst[i] = src[i]) != '\0'; i++)  ;"
  42.  
  43. I am sure many would disagree with this, I guess it depends on
  44. the purpose of the course.  "You took a course on PL/1
  45. and you still don't know about negative binary scaling factors?!"
  46. Is the purpose of the course to explore every last corner of the C language,
  47. or is it to teach some topic for which C happens to be appropriate?
  48.