home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!bigmax!folsom
- From: folsom@bigmax.UUCP (Al Folsom)
- Newsgroups: comp.lang.c
- Subject: Re: Pascal as C prelude?
- Summary: watch it!
- Message-ID: <574@bigmax.UUCP>
- Date: 23 Nov 92 14:54:40 GMT
- References: <forb0004.94.722315425@student.tc.umn.edu> <3903@dozo.and.nl> <1992Nov21.181810.29808@csservices.Princeton.EDU>
- Organization: Fischer & Porter Co., Warminster, PA.
- Lines: 60
-
- In article <1992Nov21.181810.29808@csservices.Princeton.EDU>, blume@kastle.Princeton.EDU (Matthias Blume) writes:
- >
- > |> #define SILLY_MODE
- > |> #ifdef SILLY_MODE
- > |>
- > |> There's just one drawback, when you do this: you'll end up writing
- > |> ugly formatted code like:
- > |>
- > |> if (condition)
- > |> {
- > |> statement1;
- > |> statement2;
- > |> }
- > |>
- > |> instead of the proper:
- > |>
- > |> if (condition) {
- > |> statement1;
- > |> statement2;
- > |> }
- > |>
- > |> #endif
- >
- > # define SERIOUS_MODE
- > # ifdef SERIOUS_MODE
-
- All this discussion about formatting, and I kept wondering why
- no one ever mentioned the one true style, with the braces on lines
- by themselves, indented to the same level as enclosed statements.
- Now I know -- I was actually writing Pascal back in 1979, three
- years before I thought I learned that language. What a genius
- I am! But I'm in good company, Tom Plum must also be a closet
- Pascal programmer, since the first edition of "C Programming
- Guidelines" (1984) shows that style. Wait a minute, he taught
- a few courses at my company back in 79 & 80, maybe I infected
- HIM! Oh, the shame of it all...
-
- As far as the original topic goes, I teach a course in "C" at
- a local community college. Most of my students are not full
- time students, but rather people trying to learn a new job skill.
- I don't have the luxury of multiple semester courses, or leaving
- out the "advanced" portions of the language, because they're
- going to go use it like right now. I invariably find that
- students with Pascal experience pick up C with only a little
- difficulty. Fortran programmers have a little more difficulty,
- and people with only COBOL backgrounds are doomed. Yes, Pascal
- is a good intro, more for the benefits of a background in the
- principles of structured programming, than for a direct translation
- of knowledge from one language to the other.
-
- Al Folsom
-
- +-------------------------------------------------------------------+
- | Al Folsom | Object Oriented Programming? We've |
- | Fischer & Porter Co. | been doing that for years... |
- | ...uunet!bigmax!folsom | |
- | also folsom@decus.org | When the customer objects to the way |
- | KY3T@WA3TSW (Ham) | it works, we go program some more! |
- +-------------------------------------------------------------------+
-
-