this post was submitted on 11 Dec 2024
697 points (97.8% liked)

Science Memes

11453 readers
1245 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] yetAnotherUser@discuss.tchncs.de 3 points 2 weeks ago (2 children)

And the bugs are always in the last lines of code you check. It's so infuriating! Why can't they be in the first?

[–] meowMix2525@lemm.ee 6 points 2 weeks ago

You're not desperate enough for them to reveal themselves to you yet

[–] Iron_Lynx@lemmy.world 3 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Because you stop searching when you find the bug.

You have to not execute

lines[] = Load(file.code);

bool bug_found = false;
i=0;
while(!bug_found)
{
  bug_found = findBug(lines[i]);
  //looks like I missed a bit, lemme fix
  if(bug_found)
  {
    break;
  }
  i++;
}
bug_fix(lines[i]);
// Who'd've thought that I'd need to fix a bug in a joke about fixing bugs
// Now that's some tasty irony ^-^'

You have to run

lines[] = Load(file.code);

def bugs[];
a = 0;
for(i=0;i<lines[].length();i++)
{
  if (findBug(lines[i])
  {
    bugs[a] = lines[i];
    a++;
  }
}
for(b=0;b<=a;b++)
{
  bug_fix(lines[b]);
}

/j

[–] vrighter@discuss.tchncs.de 3 points 2 weeks ago (1 children)

shouldn't b loop until it's <a instead of <=a ?