Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Richard Heathfield Newsgroups: comp.lang.c Subject: Re: Which code style do you prefer the most? Date: Thu, 6 Mar 2025 18:05:12 +0000 Organization: Fix this later Lines: 46 Message-ID: References: <20250304101022.154@kylheku.com> <20250305152224.ea400cb92445c78f6a4ba523@g{oogle}mail.com> <20250305183051.3cca469a0fd757595152b261@g{oogle}mail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 06 Mar 2025 19:05:16 +0100 (CET) Injection-Info: dont-email.me; posting-host="a12ade0f7e5b6fab51cfc5e27fedd0be"; logging-data="3241272"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GpxDM8TucqJAn2GZJ8TAgTW9/fNRQDybTooGqRRqM/g==" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:6i9l6H5elrixKR4OeCZFGhm/FD0= Content-Language: en-GB In-Reply-To: Bytes: 3061 On 06/03/2025 17:52, Richard Harnden wrote: > On 06/03/2025 14:49, Scott Lurndal wrote: >> David Brown writes: >>> On 05/03/2025 18:51, Scott Lurndal wrote: >>>> Richard Harnden writes: >>>>> On 05/03/2025 17:09, Janis Papanagnou wrote: >>>>>> On 05.03.2025 17:40, bart wrote: >>>>>>> [...] >>>> >>>>> >>>>> Seriously, short variable names for common things - i, j, k >>>>> for loop >>>>> counters; >>>> >>>> So, one might ask _why_ i, j, k instead of a, b, c? >>>> >>>> Answer: Fortran IMPLICIT INTEGER >>>> >>> >>> Nonsense. >>> >>> Ask rather why Fortran picked i, j, k for integer-type index >>> variables. >>> Their use for that function in maths /long/ predates Fortran. >> >> That doesn't mean that C programmers didn't adopt the >> use of i,j,k from FORTRAN. > > I'd always assumed it was because 'index' was too much to type, > and that j and k just followed on. > > Didn't know about any hysterical raisins. At school we used a, b, c... for trigonometry and p, q, r for point co-ordinates, so I suppose I assumed that i, j, k... for matrices was intended to exploit a nice juicy part of the alphabet that wasn't being used for anything else... ....and then along came imaginary numbers. -- Richard Heathfield Email: rjh at cpax dot org dot uk "Usenet is a strange place" - dmr 29 July 1999 Sig line 4 vacant - apply within