Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c Subject: Re: Open letter to Ian Collins Date: Mon, 28 May 2012 07:17:50 +1200 Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 3FynMWky7V31dNqDcV250gJ7XCgwDw41ndFIgKasS0dX595268cdPAbiqh7e8akPxR Cancel-Lock: sha1:uuytAGBOCocdH1FRG3JmbZGM9h0= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:12.0) Gecko/20120423 Thunderbird/12.0 In-Reply-To: Xref: csiph.com comp.lang.c:21421 On 05/27/12 11:25 PM, BartC wrote: > "Ian Collins" wrote in message > news:a2ee73F7faU5@mid.individual.net... >> On 05/27/12 09:36 PM, BartC wrote: > >>> Getting back to C, wouldn't macros and enumerations .... also >>> all benefit from being declared where they are first used? > >> I would make them longer, unlike declaring variables when they are needed >> makes them shorter. > > That's another thing; uses of i, j and k for loop indices is fairly > standard. They probably will be ints, and the formality of having to declare > them can be kept out of the way instead of making for-loops even longer. > (Alternatively for-loop variables could be implicitly declared.) Declaring loop indexes in the loop makes it clear that's what they are and that they won't spill out. >> Besides, how do you introduce a const other that where it is initialised? > > What do you mean by a const? If it is a name that is to be used in several > places, then it can also benefit from splitting declaration (and > initialisation) from it's use. const in t n = some_expression; -- Ian Collins