this post was submitted on 16 Jul 2023
1729 points (99.7% liked)

Memes

45152 readers
1967 users here now

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Pitri@lemmy.blahaj.zone 10 points 1 year ago

there is no reason for a (non-foreach) for loop to be any more or less finite than a while loop.

for (a; b; c)
{
  d;
}

is just syntactic sugar for

{
  a;
  while (b)
  {
    d;
    c;
  }
}

in most or all languages with c-like syntax.