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: [Solved] Need some help getting to my feet Date: Tue, 01 Jan 2019 12:49:56 -0800 Organization: None to speak of Lines: 25 Message-ID: References: <0db1659a-6249-47d0-8fab-baf080d32f76@googlegroups.com> <0c9de971-6b25-4b3d-b8d0-c2ab1df9efd1@googlegroups.com> <20181226190200.579c2b3b60053c907d8c80d3@g{oogle}mail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader01.eternal-september.org; posting-host="a1e3a0589224a2dccf0492cf179df393"; logging-data="29310"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++kwfbBPzJf17gS66lT1FP" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:nwE89VIbl7tptnSL9NZ3AWEf0ZQ= sha1:KY2rv8MKKeWskinZH7vIIyT1PYY= Xref: csiph.com comp.lang.c:139334 rbowman writes: > On 01/01/2019 12:14 PM, Ike Naar wrote: >> On 2018-12-31, Bart wrote: >>> There are quite a few issues with having declarations scattered >>> anywhere, such as having to locate the declaration for name (which will >>> involve scanning every line backwards to the top of a function). >> >> Often those declarations are not "scatterd anywhere", they are >> just a few lines above the point where the name is used so >> there is no need to scroll back to the top of the function. > > At times when I'm modifying existing code I will put the new > declarations in the block where they are used. It's a signal to future > maintenance programmers that the block wasn't original functionality and > was added for some reason. We use Subversion so they can easily do 'svn > blame' to find the bug reference. I don't see how that signals that the code was added later. Why wouldn't it have been written that way in the first place? -- Keith Thompson (The_Other_Keith) kst@mib.org Will write code for food. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"