Sujet : Re: Clair Grant on VMS code base
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : comp.os.vmsDate : 19. Apr 2025, 14:25:25
Autres entêtes
Organisation : To protect and to server
Message-ID : <vu0883$2q331$1@paganini.bofh.team>
References : 1 2 3 4 5 6 7 8 9
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
On Thu, 17 Apr 2025 08:56:17 -0400, Arne Vajhøj wrote:
If we discuss what is the "right" answer, then I would actually say 2.
for i := 1 to 10 do writeln(i)
for i := 1 to 10 do
writeln(i)
for i := 1 to 10 do begin
writeln(i)
end;
for i := 1 to 10 do begin
writeln(i)
end;
for(i = 1; i <= 10; i++) printf("%d\n", i);
for(i = 1; i <= 10; i++)
printf("%d\n", i);
for(i = 1; i <= 10; i++) {
printf("%d\n", i);
}
for(i = 1; i <= 10; i++)
{
printf("%d\n", i);
}
I would say 2 for all.
How much difference would such distinctions make in real-world code,
anyway? I suspect not much. Longer compound statements would dominate
shorter ones in the line count.
I would expect about 20% difference. I saw a case when lead developer
thought that code is "takes too much vertical space" and spent
substantial effort to reformat it. IIRC on files having few thousends
lines he made files shorter by about 10-15%. IIRC he changed code
formatting, keeping comments mostly as-is. Also, he worked within
mandated GNU brace placement rule, theoretically files could be
shortened more by switching to more compact brace placement rule.
-- Waldek Hebisch