Xref: utzoo comp.lang.c:33479 alt.religion.computers:2009 Path: utzoo!utgpu!cs.utexas.edu!wuarchive!emory!att!att!ima!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c,alt.religion.computers Subject: Re: Argument declaration style (Was: ANSI C prototypes) Message-ID: <1990Nov06.233654.29974@dirtydog.ima.isc.com> Date: 6 Nov 90 23:36:54 GMT References: <1990Nov2.030556.27759@ccu.umanitoba.ca> <3933.27353319@cc.helsinki.fi> <_1X6_32@xds13.ferranti.com> <3944.27367fb2@cc.helsinki.fi> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Reply-To: karl@ima.isc.com (Karl Heuer) Organization: Interactive Systems Lines: 26 In article <3944.27367fb2@cc.helsinki.fi> jaakola@cc.helsinki.fi writes: >Yeah, everything *would* work fine, if we assumed infinite line width! It consumes more width than your style, but it also consumes less height. I consider that a useful tradeoff, as it makes it more likely that the entire function will fit on a single screen. (Also, I very rarely have a function whose prototype doesn't fit on a single line.) >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. This is interesting, because I use the exact same argument in *favor* of the new style. If you write void foo(x, y) char *x; int y; { and you grep for the declaration, you don't see the types of the arguments. (And it's even worse if you put the "void" on a separate line!) With void foo(char *x, int y) { you see all the relevant information at once. Even with pre-ANSI code I use void foo(x, y) char *x; int y; { for the same reason, but the invention of prototypes made most lines shorter. Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint