Xref: utzoo comp.lang.c:33464 alt.religion.computers:2003 Path: utzoo!attcan!uunet!samsung!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!news.funet.fi!hydra!hylka!jaakola From: jaakola@cc.helsinki.fi Newsgroups: comp.lang.c,alt.religion.computers Subject: Argument declaration style (WAS: ANSI C prototypes) Message-ID: <3944.27367fb2@cc.helsinki.fi> Date: 6 Nov 90 09:17:37 GMT References: <1005@christopher-robin.cs.bham.ac.uk> <1906@necisa.ho.necisa.oz> <1990Nov2.030556.27759@ccu.umanitoba.ca> <3933.27353319@cc.helsinki.fi> <_1X6_32@xds13.ferranti.c Lines: 47 om> Followup-To: m> Xref: hylka comp.lang.c:12516 alt.religion.computers:1470 Organization: University of Helsinki Lines: 43 In article <_1X6_32@xds13.ferranti.com>, peter@ficc.ferranti.com (Peter da Silva) writes: > If you do this: > > static void auxilary_func(int a) > { > ... > } > > Everything will work fine. You only need declare it once. Just do it right > the first time and you won't have to do it again (my father always used to > tell me that). Yeah, everything *would* work fine, if we assumed infinite line width! BUT: - computer screens have finite number of columns - my favourite editor has finite line width - my printer has finite line width - I don't like wrapped lines I have made an applications generator by simulating object-oriented methods with plain C (for portability reasons), and I have some functions with about 10 arguments. And I like descriptive (=long) names; the arg in the example was "a" for pedagogical reasons... The most significant advantage of the "old" style is that I can use the command grep \)$ *.c in UNIX or in MS-DOS with the PICNIX utilities to get output like myfile.c:int foo(a,b) mydb.c:BOOL open_db(dbname,audit_file,username,password) mydb.c:BOOL get_record(key,buffer,bufferlen) .. The point is: with the old style you can put enough information on a SINGLE line - the most natural unit of textual information in UNIX- like environments. -- Juhani Jaakola, University of Helsinki