| Deutsch English Français Italiano |
|
<vj3tqa$3o9ef$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: Re: question about linker Date: Sun, 8 Dec 2024 11:52:58 +0100 Organization: A noiseless patient Spider Lines: 36 Message-ID: <vj3tqa$3o9ef$1@dont-email.me> References: <vi54e9$3ie0o$1@dont-email.me> <vidnp3$1ovvm$2@paganini.bofh.team> <vihpjh$2hgg1$1@dont-email.me> <vihrh1$2hk5l$1@dont-email.me> <vii0jp$2jkd9$1@dont-email.me> <viifv8$2opi7$1@dont-email.me> <vik28b$390eg$1@dont-email.me> <vik8tc$3ang9$1@dont-email.me> <vikjff$3dgvc$1@dont-email.me> <viku00$3gamg$1@dont-email.me> <vil0qc$3fqqa$3@dont-email.me> <vil82t$3ie9o$2@dont-email.me> <vila9j$3j4dg$1@dont-email.me> <vin4su$49a6$1@dont-email.me> <vin95m$5da6$1@dont-email.me> <vinh3h$7ppb$1@dont-email.me> <vinjf8$8jur$1@dont-email.me> <vip5rf$p44n$1@dont-email.me> <viprao$umjj$1@dont-email.me> <viqfk9$13esp$1@dont-email.me> <viqhmn$131h8$3@dont-email.me> <visbmp$1ks59$1@dont-email.me> <visgs7$1mgdb$1@dont-email.me> <viv5ve$2dqir$1@dont-email.me> <vivggi$2gkth$1@dont-email.me> <vj1r8n$35lal$1@dont-email.me> <vj1uge$36ugq$1@dont-email.me> <vj22ce$37g4b$1@dont-email.me> <vj263c$396ln$1@dont-email.me> <vj2d21$3aqf3$1@dont-email.me> <vj2e34$3b1j8$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 08 Dec 2024 11:52:59 +0100 (CET) Injection-Info: dont-email.me; posting-host="90ad15a344bc4dfe05e7ef38d439f736"; logging-data="3941839"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Boy3ZpfhI3gNPtaAcBLfmMBgu66FvrNk=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:pWmeLsXmquW0SHtrs0q1o73NdL4= Content-Language: en-GB In-Reply-To: <vj2e34$3b1j8$1@dont-email.me> Bytes: 3399 On 07/12/2024 22:18, Bart wrote: > On 07/12/2024 21:00, David Brown wrote: > >> <snip purely subjective opinion on unrealistic code> > > You mean that /real/ example where a function needed a type written 6 > times instead of once? OK. > > I'd be curious about how you'd write such a function; maybe all your > functions only have one parameter, or they are always of mixed types. Having so many parameters in a function is a sign of a bad interface design - the more parameters, the poorer the design. Occasionally having 6 parameters might be the best choice in a particular case, but it is going to be rare - most functions have far fewer. And it's okay if things are a bit awkward or harder to write for something that should be rare, and is rare in practice. The problem is not so much when defining or declaring the function - it is when /using/ the function. C does not have named arguments, and it is extremely easy for code calling a function of many parameters to mix them up (especially if they are the same type). I'd have been quite happy if C had a syntax along the lines of int foo(int a, b, c, double x, y, z); for declaring functions. It can't quite follow the same pattern as for declarations of variables (because then you'd need a semicolon after the "c" above), but it would be close. But C doesn't have a syntax like that, and the syntax it has is rarely an issue for anyone.