Sujet : Re: Which code style do you prefer the most?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 27. Feb 2025, 07:34:24
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vpp11h$30kov$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 26.02.2025 20:32, John McCue wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
<snip>
The guys old enough to have punched cards - call me a member of this
group - will probably prefer to not write the opening brace on that
same line but open a new line for it, as in
>
if (flag)
{
doThis();
orThat();
}
But back then, were there any languages outside of academia
that used braces and was used in the commercial world (on
punch cards) ?
Well, I used punch cards only in my University days. I'm sure
to have coded Algol 68 on punch cards, and maybe also Pascal.
Algol 68 allows the use of parenthesis as alternate form of
begin/end (for example) but I don't recall whether I had used
that form when coding.
I knew of none, but my Punch Card days only lasted a couple
of months (I had a job doing FORTRAN on punch cards).
From the "commercial world" I have only Cobol, PL/1, Fortran
in mind; I seem to recall none of them working with begin/end
parenthesis or braces.
FWIW, the only languages I knew in the commercial world that
where being used back then was COBOL, FORTRAN and Assembly.
But let us not lose sight of that Scott likely brought up the
punch card drift as a humorous element in the argumentation.
Janis
PS (anecdotal story): The punch cards implied a different style
of working; you spent a lot of care to formulate the algorithms
correctly and punch accurately since you had to put your stack
of cards into the physical batch queue, then had to wait until
it got read in, and finally you got your output (the results, or
list of compile errors) later. (In the meantime you could visit
the lectures.) - Once I came back to get my output and found it
on the first glimpse cluttered with unexpectedly many errors. On
a closer look I noticed that all errors were of the same type;
all 'begin' tokens were replaced by 'sadat' tokens. - A fellow
student made sort of a political joke; he took my punch cards
from the batch queue and replaced the respective cards. Needless
to say that I wasn't amused to have lost an whole hour waiting
for the results. (But I won't forget that joke.)