Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.lang.c Subject: Re: Which code style do you prefer the most? Date: Wed, 5 Mar 2025 19:50:04 +0100 Organization: A noiseless patient Spider Lines: 26 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=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 05 Mar 2025 19:50:06 +0100 (CET) Injection-Info: dont-email.me; posting-host="c7b28c7b2c5da4ab81c18f27a162cf8b"; logging-data="2681180"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18H81caVvspHs2LWNx5OW18" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:2QvM5ysL8oplEGS6k6y6GvVJ+/Q= In-Reply-To: X-Enigmail-Draft-Status: N1110 Bytes: 2421 On 05.03.2025 18:51, Scott Lurndal wrote: > Richard Harnden writes: >> >> 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 Ah, right! I forgot about that. - But is that the answer? We've got such conventions from math; a, b, c, for lines, x, y, z, for coordinates, p, q, r, for points, i, j, k, for indexes, and so on. Loops often iterate over indexes. Janis -- for (number_of_natively_born_people_in_coast_states_without_havens = 0; number_of_natively_born_people_in_coast_states_without_havens <= maximum_number_of_natively_born_people_in_coast_states_without_havens; number_of_natively_born_people_in_coast_states_without_havens++) Segmentation fault (core dumped)