Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!mangoe From: mangoe@mimsy.UUCP (Charley Wingate) Newsgroups: comp.lang.misc Subject: Re: Check the Arg Count Message-ID: <4895@mimsy.UUCP> Date: Thu, 1-Jan-87 03:12:20 EST Article-I.D.: mimsy.4895 Posted: Thu Jan 1 03:12:20 1987 Date-Received: Thu, 1-Jan-87 06:35:43 EST References: <3101@diamond.Diamond.BBN.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 36 Rick Genter writes all sorts of flamy things about C and lint and arg count checking. In his haste he makes a pile of errors. First off, he erroneously implied that I claimed that there should be no variable length argument lists. What I actually said was that the declaration syntax should make it obvious that variable length arg lists are permissible. Perhaps the ANSI C committee is composed entirely of morons, but I have been informed by one of the members that the ANSI standard is in fact going to have a portable method for dealing with variable argument lists which will make just the sort of requirement I want to see. I also note that in fact Pascal for one HAS variable argument lists-- for certain system routines such as READ and WRITE. SO does FORTRAN (MAX and MIN are examples). In C by contrast the current mechanism is terribly defective, as Kernighan and Richie point out (p. 71). For example, it is impossible to write a general MAX routine that takes and indefinitely large number of integers, unless you explicitly tell it how many values to look for. I fail to see the advantage in having separate style and syntax checkers. In COBOL, for instance, you will find that most compilers go to a lot of trouble to tell you that "this looks supicious". THe same is true of FORTRAN. THe only "advantage" I see to separating the two functions is that it's easier to justify an undiciplined, tricky coding style because you are constantly confronted by the compiler's disapproving messages. I cannot at all see any defense for allowing the use of variable argument lists to remain implicit in the program; it's undiciplined and leads to needless errors. Pascal, of course, takes a very extreme viewpoint on this. Considering its teaching language heritage, I find it hard to attack the decision that was made. Students need to learn to write diciplined programs before they go out and break all the rules, and thus there's advantage to be had in making those sort of restrictions syntactic requirements. (ADA I won't comment on because I don't know the syntax well enough.) C. Wingate