Sujet : Re: Loops (was Re: do { quit; } else { })
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 18. Apr 2025, 15:57:24
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vttp8l$38dp9$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 16.04.2025 11:45, Rosario19 wrote:
On Tue, 15 Apr 2025 09:25:40 +0200, Janis Papanagnou wrote:
On 15.04.2025 06:57, Rosario19 wrote:
On 13.04.2025 18:39, bart wrote:
[...]
>
for(let i = 1; i <= 36; i++) {
>
C for loop is great, but all can be workarounded with goto label
>
Sure. Or all done with Turing machines. - But why would one want to.
because one not has the for loop, because is need more flexibility in
what code has to make, because one find so easy goto label, that it is
easier of the loop for, even if i think in 80% of cases for loop is
less chars and easier of the loop that use goto label
(Note my question above was rhetorical. - Turing machine programs is
not something you should consider as scale for what we usually do in
programming.)
Of course, if all you have is an assembler language then "all" you
have are jumps. (Note: again an accentuated formulation of the point,
but I'm confident you understand what I'm trying to say.)
If, for common loop conditions, it's easier for someone to use gotos
than to use typical loop constructs then I suggest that this person
should not apply for a programmers' job.
The "number of characters" in a syntactical construct is IMO not the
most relevant or primary factor. But abstractions in languages often
coincide with much terser formulations. And abstractions is what aids
in programming non-trivial systems. I would abstain from gotos, but
because of the "number of characters" to type or to spare.
Janis