Xref: utzoo comp.lang.c:34350 alt.religion.computers:2113 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!ccu.umanitoba.ca!salomon From: salomon@ccu.umanitoba.ca (Dan Salomon) Newsgroups: comp.lang.c,alt.religion.computers Subject: Re: Argument declaration style (Was: ANSI C prototypes) Message-ID: <1990Nov28.183850.20592@ccu.umanitoba.ca> Date: 28 Nov 90 18:38:50 GMT References: <1990Nov2.030556.27759@ccu.umanitoba.ca> <3933.27353319@cc.helsinki.fi> <_1X6_32@xds13.ferranti.com> <3944.27367fb2@cc.helsinki.fi> <1990Nov06.233654.29974@dirtydog.ima.isc.com> Organization: University of Manitoba, Winnipeg, Canada Lines: 25 In article <1990Nov06.233654.29974@dirtydog.ima.isc.com> karl@ima.isc.com (Karl Heuer) writes: > ... (Also, I very rarely have a function > whose prototype doesn't fit on a single line.) > > Even with pre-ANSI code I use > void foo(x, y) char *x; int y; { This is kind of a wimpy example isn't it? When working on a large project like a compiler, or a CAD tool, one tends to get MUCH longer variable names and type names. Even two-parameter function headers can get rather large in such cases. E.g. ST_Gen_Class *ST_Lookup_No_Err (char *found_symb; Scope_Level_Ptr Start_Scope); This is a fictious example, but more resembles my code than does your example. With single-letter formal parameter names, the spaces, stars, and semicolons are quite visible, but with longer parameter and type names, they tend to get lost. For long headers like these, splitting the formal parameters across lines improves readability. -- Dan Salomon -- salomon@ccu.UManitoba.CA Dept. of Computer Science / University of Manitoba Winnipeg, Manitoba, Canada R3T 2N2 / (204) 275-6682