home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19061 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.5 KB  |  38 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!stanford.edu!nntp.Stanford.EDU!dkeisen
  3. From: dkeisen@leland.Stanford.EDU (Dave Eisen)
  4. Subject: Re: Function definition style
  5. Message-ID: <1992Dec31.054359.13226@leland.Stanford.EDU>
  6. Sender: ?@leland.Stanford.EDU
  7. Organization: Sequoia Peripherals, Inc.
  8. Date: Thu, 31 Dec 92 05:43:59 GMT
  9. Lines: 27
  10.  
  11. >>I try to use the style in ansi k&r, but I notice that others are using this
  12. >>style and I assume they aren't all using pre-ansi compilers.
  13. >
  14. >IMHO, one should be *very* careful in picking up coding habits from other
  15. >programmers.  Often a programmer will use a particular feature or style
  16. >out of laziness or ignorance of superior alternatives.
  17.  
  18. Or for other perfectly valid reasons like portability. There
  19. are still a fair number of folks left who use compilers that
  20. don't understand prototypes.
  21.  
  22. But Dave's point is valid. You shouldn't use a particular style
  23. just because other programmers use it --- their needs may be 
  24. different from yours so they may have chosen their style for
  25. reasons that don't apply to you. In this case, using prototypes
  26. is such a big win over using C Classic function definitions that
  27. unless portability to pre-ANSI compilers is a major design goal
  28. of your project, you should use the ANSI style of function
  29. definition.
  30.  
  31.  
  32.  
  33. -- 
  34. Dave Eisen                               Sequoia Peripherals: (415) 967-5644
  35. dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
  36.        There's something in my library to offend everybody. 
  37.           --- Washington Coalition Against Censorship
  38.