Bilb!
link
fedilink
-2
edit-2
1Y

WTF, I have never used nor seen “j.”

I don’t usually have to name these variables these days though. Pretty much everything I use has foreach or some functional programming type stuff.

And like that, the off-by-one mistakes disappear.

j is for a loop in a loop.

@SaratogaCx@lemmy.world
link
fedilink
English
31Y

It was very common in text books when showing nested loops

int nWhatTheCount = 0;
for (int i = 0; i < 10; i++) { 
    for (int j = 0; j < i; j++) { 
        for (int k = 0; k < j; k++) { 
            for (int l = 0; l < k; l++) { // and on, and on
                nWhatTheCount++;
            }
        }
    }
}
Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 120 users / day
  • 257 users / week
  • 744 users / month
  • 3.72K users / 6 months
  • 1 subscriber
  • 1.47K Posts
  • 32.3K Comments
  • Modlog