Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c++
Subject: Re: overuse of auto is dangerous
Date: Thu, 02 Apr 2020 07:13:06 -0700
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <86imii6knh.fsf@linuxsc.com>
References: <87tv2pqm0i.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="b8d048feb5cbf1a44d80a9279d4cb30f"; logging-data="19783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rUvrColAV11bpiBFY3lUhW9ydG4IAE3E="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:z95m3Zvvv4fA1JnST5gxvKQQwws= sha1:Ib40+KmBKByyYC5alhF/gfzugVI=
Xref: csiph.com comp.lang.c++:72752
Keith Thompson writes:
> David Brown writes:
>
>> On 14/03/2020 18:23, Bart wrote:
>
> [...]
>
>>> C, and I assume C++, allows this:
>>>
>>> void fn(int sum, int prod);
>>> void fn(int prod, int sum) {....}
>>>
>>> If only the declaration is visible at the call-site, it will be misleading.
>>
>> Yes. That is one thing I strongly dislike about the languages, and it
>> is a big hinder to having a simple system of named parameters.
>> However, it is also clear that there are some /good/ reasons for
>> allowing different names for parameters.
>
> [...]
>
> Good reasons for using a different name for the same parameter in a
> declaration and definition of a function? I can't think of any.
Do you think it's possible that, for reasons of their own,
someone would deliberately choose to use a different name for
some function parameter where the function is declared, as
compared to where the function is defined, even though you
can't think of any good reason to do so?