Sujet : Re: Which code style do you prefer the most?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 05. Mar 2025, 18:09:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqa0gr$2gmc7$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 05.03.2025 17:40, bart wrote:
[...]
Now some use ridiculously long identifiers. And actually, some compilers
don't have a cap on the length. I once tried to compile code like this
with gcc:
int a, b, c;
a = b + c;
but using machine-generated billion-character identifiers. I think it
worked, eventually.
The context in the thread this came up in was whether names should have
any limit on the length (my tools capped them at 255 characters), and
most thought they shouldn't. But even 255 characters would be hopelessly
impractical if using a text editor.
Your choice is IMO large enough with plenty of room for pathological
variable name lengths. The longest name constructs I encountered was
in Java contexts; first of all long names were used, but the total
length came from sequences of dot-separated entities. (Still within
limits like 255.)
Of course, if you can prevent limits in the first place that would be
yet better. But are flexible limits necessary here in practice? (I'd
be interested to hear whether anyone encountered such long names, or
felt a need for that.[*])
Reminds me the file name evolution/revolution; in earlier days (due
to length restrictions) file names have often been abbreviated, in
more recent days file _names_ have often become file _novels_ (even
carrying other stuff, file meta-information, or complete stories in
it, sort of). - Evolving from one extreme to the other...
Janis
[*] I could imagine some compiler internal name-mangled entities.