home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 17029 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  2.7 KB

  1. Path: sparky!uunet!bigmax!folsom
  2. From: folsom@bigmax.UUCP (Al Folsom)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Pascal as C prelude?
  5. Summary: watch it!
  6. Message-ID: <574@bigmax.UUCP>
  7. Date: 23 Nov 92 14:54:40 GMT
  8. References: <forb0004.94.722315425@student.tc.umn.edu> <3903@dozo.and.nl> <1992Nov21.181810.29808@csservices.Princeton.EDU>
  9. Organization: Fischer & Porter Co., Warminster, PA.
  10. Lines: 60
  11.  
  12. In article <1992Nov21.181810.29808@csservices.Princeton.EDU>, blume@kastle.Princeton.EDU (Matthias Blume) writes:
  13. > |> #define SILLY_MODE
  14. > |> #ifdef SILLY_MODE
  15. > |> 
  16. > |> There's just one drawback, when you do this: you'll end up writing
  17. > |> ugly formatted code like:
  18. > |> 
  19. > |> if (condition)
  20. > |>     {
  21. > |>     statement1;
  22. > |>     statement2;
  23. > |>     }
  24. > |> 
  25. > |> instead of the proper:
  26. > |> 
  27. > |> if (condition) {
  28. > |>     statement1;
  29. > |>     statement2;
  30. > |> }
  31. > |> 
  32. > |> #endif
  33. > # define SERIOUS_MODE
  34. > # ifdef SERIOUS_MODE
  35.  
  36. All this discussion about formatting, and I kept wondering why
  37. no one ever mentioned the one true style, with the braces on lines
  38. by themselves, indented to the same level as enclosed statements.
  39. Now I know -- I was actually writing Pascal back in 1979, three
  40. years before I thought I learned that language.  What a genius
  41. I am!  But I'm in good company, Tom Plum must also be a closet
  42. Pascal programmer, since the first edition of "C Programming
  43. Guidelines" (1984) shows that style.  Wait a minute, he taught
  44. a few courses at my company back in 79 & 80, maybe I infected
  45. HIM!  Oh, the shame of it all...
  46.  
  47. As far as the original topic goes, I teach a course in "C" at 
  48. a local community college.  Most of my students are not full 
  49. time students, but rather people trying to learn a new job skill.
  50. I don't have the luxury of multiple semester courses, or leaving
  51. out the "advanced" portions of the language, because they're 
  52. going to go use it like right now.  I invariably find that 
  53. students with Pascal experience pick up C with only a little 
  54. difficulty.  Fortran programmers have a little more difficulty,
  55. and people with only COBOL backgrounds are doomed.  Yes, Pascal
  56. is a good intro, more for the benefits of a background in the 
  57. principles of structured programming, than for a direct translation
  58. of knowledge from one language to the other.
  59.  
  60. Al Folsom
  61.  
  62. +-------------------------------------------------------------------+
  63. | Al Folsom                 | Object Oriented Programming?  We've   |
  64. | Fischer & Porter Co.      | been doing that for years...          |
  65. | ...uunet!bigmax!folsom    |                                       |
  66. | also folsom@decus.org     | When the customer objects to the way  |
  67. | KY3T@WA3TSW (Ham)         | it works, we go program some more!    |
  68. +-------------------------------------------------------------------+
  69.  
  70.