Deutsch   English   Français   Italiano  
<vin8is$584m$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Tue, 3 Dec 2024 16:36:59 +0100
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <vin8is$584m$1@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vicque$15ium$2@dont-email.me>
 <vid110$16hte$1@dont-email.me> <87mshhsrr0.fsf@nosuchdomain.example.com>
 <vidd2a$18k9j$1@dont-email.me> <8734j9sj0f.fsf@nosuchdomain.example.com>
 <vidnuj$1aned$1@dont-email.me> <87ttbpqzm1.fsf@nosuchdomain.example.com>
 <vie0j5$1g968$1@dont-email.me> <vieun5$1mcnr$3@dont-email.me>
 <vihamj$2cflq$1@dont-email.me> <vihili$2f79m$1@dont-email.me>
 <vihu63$2ipg0$1@dont-email.me> <vii3kq$2kmc8$1@dont-email.me>
 <vikqvf$3fhce$1@dont-email.me> <jNm3P.7909$XuU6.3431@fx40.iad>
 <86v7w1muem.fsf@linuxsc.com> <vin6em$49d1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 03 Dec 2024 16:37:00 +0100 (CET)
Injection-Info: dont-email.me; posting-host="9a93823db46cec37792acbf277ad57d1";
	logging-data="172182"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/0N4roooe2MWu6DVnWsDEg"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:h2ljFAN9HEWFAf0GbHvBivF5NaA=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <vin6em$49d1$1@dont-email.me>
Bytes: 3048

On 03.12.2024 16:00, David Brown wrote:
> 
> A general guideline followed by most people is to have the length of
> identifiers (or their semantic content) increase with larger scope of
> the identifier.  "i" is fine as a counter of a small loop, but you would
> not want to use it for a file-scope static.

We've basically had just two types; semantical entities with
explicit names, and local technical entities. But we anyway
hadn't handled that too strictly; feedback from code-reviews
corrected the worst excesses, or suggested name alternatives.

> [...]
> 
> But I dislike it when people use things like "indx" for "index" or "cnt"
> for "count".

(I also dislike saving single characters "indx" or "creat()".)

Actually in local contexts (small scope) I have no issues with
writing 'c' instead of 'count', or 'msg' instead of 'message'.

The terser formulation (in a local structure) I think usually
increases readability.

Typically 'count' appears not being better than 'c' since both
are technical entities and don't carry semantical information,
in contexts like 'count++' or 'c++' you see it's counting even
when writing 'x++' or 'foobar++'.

Where the semantics of such an entity is relevant its name was
even larger, like, say, 'inhabitants_count'. Or you may even
strip the technical count 'inhabitants++', or 'nof_inhabitants'
(we used the common "number of ..." abbreviated as "nof_...").

Janis