home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19050 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!rpi!usenet.coe.montana.edu!news.u.washington.edu!stein.u.washington.edu!chuckb
  2. From: chuckb@stein.u.washington.edu (Charles Bass)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Function definition style
  5. Date: 30 Dec 1992 23:01:48 GMT
  6. Organization: University of Washington
  7. Lines: 28
  8. Message-ID: <1ht9osINNchb@shelley.u.washington.edu>
  9. References: <1992Dec30.223045.29467@news2.cis.umn.edu>
  10. NNTP-Posting-Host: stein.u.washington.edu
  11.  
  12. wright@staff.tc.umn.edu (Mark Wright) writes:
  13.  
  14. >Is there any good reason not to use the following style for defining
  15. >functions:
  16.  
  17. >type function_name( varname1, varname2, varname3 )
  18.  
  19. >type varname1;
  20. >type varname2;
  21. >type varname3;
  22.  
  23. >I try to use the style in ansi k&r, but I notice that others are using this
  24. >style and I assume they aren't all using pre-ansi compilers.  My problem is
  25. >that to use Brief's function listing command the end paren must be on the same
  26. >line as the function name, which is difficult to do using k&r 2 style if the 
  27. >function needs several structs as parameters.  Besides, it's easier to
  28. >document function parameters with k&r 1 style.  Is there any good reason
  29. I dont think it's any easier to document parameters using this
  30. style.  For example:     
  31.  
  32. type function_name(
  33.     type varname1,  /* comments */
  34.         type varname2,  /* more comments */
  35.     type varname3)  /* even more comments */
  36.  
  37. works just fine in the ansi world of function headers.
  38.  
  39. chuckb
  40.