home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
- From: dave@cs.arizona.edu (Dave Schaumann)
- Newsgroups: comp.lang.c
- Subject: Re: Most difficult part of learning C?
- Message-ID: <1992Aug31.171806.5168@organpipe.uug.arizona.edu>
- Date: 31 Aug 92 17:18:06 GMT
- References: <9208251159.AA04122@ult4> <1992Aug26.103256.5267@itnsg1.cineca.it> <drice.714872469@ponder> <714939390@romeo.cs.duke.edu>
- Sender: news@organpipe.uug.arizona.edu
- Reply-To: dave@cs.arizona.edu (Dave Schaumann)
- Distribution: usa
- Organization: University of Arizona
- Lines: 52
- In-Reply-To: trt@duke.cs.duke.edu (Tom Truscott)
-
- In article <714939390@romeo.cs.duke.edu>, trt@duke (Tom Truscott) writes:
- >The biggest difficulty in learning C that I have encountered
- >is the lack of a hand-holding coding&testing environment.
-
- Yeah. One of the first programs I wrote did some simple array manipulation.
- I couldn't figure out why it was crashing on exit. After much head-scratching
- and code dissection, I finally realized that I was accessing my arrays from
- 1 to N instead of 0 to N-1.
-
- Now, the fact that C will let you do just about anything you want is very
- useful to the experienced programmer, but it also has the tendency to
- ensnare the neophyte.
-
- IMHO, I think that new programmers can profitably start out in C -- they
- just need to be aware of the pitfalls. Even a short list of rules could
- be eminantly helpful. But if you just send them out there with no
- preperation... all you're going to get is a roomfull of students that hate C.
-
- >A difficulty I have not seen mentioned is in learning how
- >to use the boolean operators & | ^ ~.
-
- Of course, these are not boolean operators -- they are bit operators.
- But I agree. They can easily be skipped.
-
- >Some difficulties can be circumvented by avoiding them entirely.
- >In my opinion the following can be omitted:
- [...]
- > enumerated types
-
- What?! Noooo! Enumerated types are an incredibly useful feature!
- The ability to give things a symbolic name is essential to good
- programming.
-
- [...]
- > typedefs
-
- Similarly with typedefs. Perhaps you don't need them in a first semester
- programming class, but I wouldn't delay introducing them past the second
- semester. Like symbolic names, the ability to construct abstract types
- (as opposed to clusters of structs and pointers) is essential to programming.
-
- >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?
-
- IMHO, the purpose of the course should be to teach programming first, and C
- second. If approached in the right manner, C's draw-backs can even be used
- to advantage in a programming course (show how to program defensively, show
- the importance of formatting your code reasonably, and choosing good variable
- names, etc., etc.)
-
- --
- Dave Schaumann dave@cs.arizona.edu
-