Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown Newsgroups: comp.lang.c Subject: Re: Recursion, Yo Date: Fri, 12 Apr 2024 09:30:18 +0200 Organization: A noiseless patient Spider Lines: 42 Message-ID: References: <87edbestmg.fsf@bsb.me.uk> <_zSRN.161297$m4d.144795@fx43.iad> <20240411075825.30@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 12 Apr 2024 09:30:19 +0200 (CEST) Injection-Info: dont-email.me; posting-host="085f1be00dfebd806a614550c40cad96"; logging-data="2353896"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19P2NPJktlxjp/XvxQ+FBy5GH/0nj1yl5U=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:/5ZpcwJOQCrMxWHzOG5mWjBJD44= Content-Language: en-GB In-Reply-To: Bytes: 2818 On 12/04/2024 07:32, Janis Papanagnou wrote: > On 12.04.2024 04:31, Lawrence D'Oliveiro wrote: >> On Thu, 11 Apr 2024 15:15:35 GMT, Scott Lurndal wrote: >> >>> As someone who cut his teeth on >>> Unix V6, an empty parameter list is less self-documenting than an >>> explicit (void). >> >> Should that apply when calling the function as well? >> >> res = func(void); >> >> instead of >> >> res = func(); >> >> ? > > Ideally it would be (without syntactic ballast) just > > res = func; > > (as many programming languages have it designed), in > function definition and function call; no parameters, > no unnecessary parenthesis. > > (Even Algol 68, where I've seen 'void' mentioned for > the first time, does not use 'void' for an empty > function argument list definition or function call.) > > But we use C here, so we have to take what's given. > I prefer the consistency of function calls using parenthesis. The consistent alternative, found in some other languages, is that they never need parenthesis - "foo a b" calls "foo" with parameters "a" and "b". (Of course you'd need some syntax for referring to the function itself, or its address - "fp = &foo;" would not be too onerous, IMHO.)