Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: overuse of auto is dangerous Date: Thu, 02 Apr 2020 10:25:35 -0700 Organization: None to speak of Lines: 36 Message-ID: <87zhbtssts.fsf@nosuchdomain.example.com> References: <87tv2pqm0i.fsf@nosuchdomain.example.com> <86imii6knh.fsf@linuxsc.com> <434bb7d9-7343-4894-96f6-705f96cb68b9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="3819bc2a00f7d30b644a1b83a43bdfb4"; logging-data="15331"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rLQVKKGmiJHtLjuhfh+Qz" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:lNxNyrBnSA0simq5VNY5WhyHXac= sha1:tAOP4DVLOzhyFZiX6Rl0JliHqAA= Xref: csiph.com comp.lang.c++:72759 James Kuyper writes: > On Thursday, April 2, 2020 at 10:13:17 AM UTC-4, Tim Rentsch wrote: >> Keith Thompson writes: > ... >> > 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? > > There's no inconsistency between that possibility and what Keith said; > people often do things without having a good reason for doing them. Or for good reasons that I'm not aware of. > He also only said that he couldn't think of any good reasons - that > wording explicitly allows for the possibility of reasons he couldn't > think of. In fact, his comment could even be interpreted as an > invitation to enlighten him about what such reasons might be. Can > you so enlighten him? If not, there was really no point in > responding. A bit of background. Much of my programming experience is in Ada, which allows separate declarations and definitions of functions and procedures in a manner similar to C and C++. Ada does not allow parameter names to differ between the declaration and definition (nor does it allow them to be omitted). I never found that the least bit inconvenient. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */