home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20968 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.0 KB

  1. Xref: sparky comp.sys.mac.programmer:20968 comp.sys.mac.oop.misc:202
  2. Newsgroups: comp.sys.mac.programmer,comp.sys.mac.oop.misc
  3. Path: sparky!uunet!cs.utexas.edu!wupost!csus.edu!netcom.com!gort
  4. From: gort@netcom.com (george harrington)
  5. Subject: Re: David Betz and Bob Language
  6. Message-ID: <1993Jan8.090854.13216@netcom.com>
  7. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  8. References: <01050133.mp32gx@distant.uucp> <1i886lINNg1v@tamsun.tamu.edu>
  9. Date: Fri, 8 Jan 1993 09:08:54 GMT
  10. Lines: 40
  11.  
  12. In article <1i886lINNg1v@tamsun.tamu.edu> bpb9204@tamsun.tamu.edu (Brent Burton) writes:
  13. >edw@distant.uucp writes:
  14. >|
  15. >|It's written in K&R C, and does wierd things with function arguments. For
  16. >|instance, it'll define a function like this:
  17. >|
  18. >|do_expr()
  19. >|{ [...] }
  20. >|
  21. >|and then call it with arguments! You don't do things like this in ANSI C,
  22. >
  23. >Welcome to the weird, wild, wooly world of RealWorld Programming!
  24. >I'm not trying to belittle you in any way, but I've just seen *so many*
  25. >programs with code like this -- and they still work.  Amazing.
  26. >
  27. >As you delve deeper into the worlds of other hacker's code, you'll see
  28. >more and more weird things (like passing 12 arguments to a function just
  29. >because the programmer didn't use variable argument lists - ala GNU Bison -
  30. >and then only using 3 in common usage.  You'd think these guys never heard
  31. >of a parameter block or data structures before, but I digress.)
  32. >
  33. >|3. Knows what the hell is happening with the stuff I described above.
  34. >
  35. >Well, the stuff, for the most part, will work, but I can't put too much
  36. >confidence into code that uses anticonventions like your above example.
  37. >
  38. Actually, this is the way functions are defined in unix shells; probably
  39. the reasoning is to allow for a variable number of parameters. You 
  40. would write 
  41.    for i
  42.    do
  43.       some code here
  44.    done
  45.  
  46. and i would loop across all the parameters.
  47.  
  48.  
  49. -- 
  50. george harrington gort@netcom.COM
  51. Netcom - Online Communication Services San Jose, CA
  52.