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: Sun, 27 May 2012 22:33:07 +1200 Lines: 62 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 mRCcauprVnXoZN21WgblwQeEugHZ3FevQF7dbc7qNZ/w4wDMLLZmFRSeO55TLPpQeE Cancel-Lock: sha1:KwKHB81R0cLm+4bHhBpsSZJIHuk= 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:21405 On 05/27/12 09:36 PM, BartC wrote: > > > "Ian Collins" wrote in message > news:a2dhipF7faU1@mid.individual.net... >> On 05/27/12 10:22 AM, jacob navia wrote: >>> Hi Ian >>> >>> In the c++ newsgroup you asked me for an example of the ccl performance >>> It was something with building a huge list, then sorting it, if I >>> remember correctly... >>> >>> I have built this example code: >>> >>> #include >>> #include "containers.h" >>> #define N 10000000 >>> int main(void) >>> { >>> List *L1; >>> size_t i,d; >>> long long sum=0,newSum=0; >>> Iterator *it; >>> int *pint; >> >> All good code should have at least one beer reference! >> >> It be a lot easier to see what is what if these were declared on first >> use. > > As in, instead of reading a play which starts with a cast of characters, > they should be introduced whenever they first appear? > > Suppose you're delving into a random scene, (or have an extract for use > elsewhere), and want to be reminded who a character is, you have to start > ploughing through from page one first until you encounter their first > mention? A function is more like a limerick than a play. > And if you are editing the play, and the character's first appearance is > edited out, or is moved somewhere where it's no longer the first appearance; > how much work is it going to be to fix up declarations properly? No a lot. > Getting back to C, wouldn't macros and enumerations (and file-scope > variables, external references, etc) also all benefit from being declared > where they are first used? (And what sort of mess would that make of any > program...). I would make them longer, unlike declaring variables when they are needed makes them shorter. Besides, how do you introduce a const other that where it is initialised? > Anyway I thought everyone used smart editors now, where you hover over a > name or something, and it tells you everything about it. Alas, Thunderbird lack that feature. -- Ian Collins