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