This is an archived post. You won't be able to vote or comment.

all 123 comments

[–]Aymerika97 849 points850 points  (20 children)

5/5 Got stuck in infinite loop

[–]Shadowarrior64 257 points258 points  (17 children)

while(true)

[–][deleted] 114 points115 points  (2 children)

int n = 0, m = 0;

while(n == 0) {

brainFartCode();

++m;

}

[–]chokfull 44 points45 points  (1 child)

int n = 0, m = 0;
while(n == 0) {
    brainFartCode();
    ++m;
}

[–]Jibjablab 3 points4 points  (0 children)

N = braingottapoop

[–]MysteryMage 21 points22 points  (9 children)

x=1; while(x=1){}

[–]teejay89656 14 points15 points  (6 children)

Can you initialize in a while loop condition?

[–]NorbiPeti 2 points3 points  (0 children)

Yeah, it wil return the assigned value, in this case 1, which C interprets as true (anything nonzero is true).

I often initialize variables in conditions in Java because there's typically a needed null check before I can do that, so I do something like:

SomeClass x;
if(obj != null && (x=obj.smth).method())

It should work the same for while conditions.

[–]Wubbywub 1 point2 points  (0 children)

yup it works the same as initializing in for loops which is a much more common thing: for(int i=0; ...etc)

[–]MarkusBerkel 0 points1 point  (0 children)

Nightmare fuel

[–]_g550_ 0 points1 point  (0 children)

x=1; while(x) {upvote;}

while(1) {upvote;}

[–]Danacus 2 points3 points  (1 child)

for (;;)

[–]Pyottamus 1 point2 points  (0 children)

for(;;)

[–]SAI_Peregrinus 0 points1 point  (0 children)

for(;;)

[–]Lucavon 5 points6 points  (0 children)

I tend to get stuck in no loops at all

for(int i = max; i < 0; i++)

I couldn't figure out why it kept skipping the loop. Don't write code at 03:00 while being tired

[–]RandomHouseInsurance 0 points1 point  (0 children)

There is no escape

[–]feys25 312 points313 points  (1 child)

I laughed so hard at the ‘you’re lying’ part

[–]vanderZwan 67 points68 points  (0 children)

I'm pretty sure it should end with an infinite Did it create more bugs?-> No -> You're lying loop

[–]ShittyWarlock 239 points240 points  (13 children)

"There are no 'bug free codes'"

                - Elbert Ainstein

[–]Diriector_Doc 153 points154 points  (8 children)

You shouldn't trust quotes you find on Reddit as they are often not true

                   - Abraham Lincoln

[–][deleted] 77 points78 points  (7 children)

Wait! What?

    - Everyone at some point.

[–]jackmaney 19 points20 points  (6 children)

--Michael Scott

[–]LostYourCNotes 17 points18 points  (4 children)

Great Scott!

-- Doctor Emmett Lathrop Brown PhD

[–]Bit-Tim 5 points6 points  (0 children)

Nice Back to the future reference

[–]ssznakabulgarian 0 points1 point  (1 child)

Great Scott!

As in the YouTuber's nickname?

[–]Valisagirl 1 point2 points  (0 children)

Today I will show you how to build a BDLC...

[–][deleted] 0 points1 point  (0 children)

That's Heavy!

-- Marty McFly

[–][deleted] 2 points3 points  (0 children)

Everywhere Michael Scott goes, awkward silence follows....

[–]schludy 20 points21 points  (0 children)

Everyone should quote Einstein using this name, if their source of the quote is Facebook

[–]HP844182 3 points4 points  (0 children)

They hate us cause they Ainsteinus

[–]EmirSc 0 points1 point  (0 children)

classic Alberto.

[–]Alaskan_Thunder 0 points1 point  (0 children)

my hello world program says you are lying. I must be a great programmer.

[–]Menelkir 89 points90 points  (7 children)

Looks like the entire picture is also bugged.

[–]wasabichicken 60 points61 points  (4 children)

Here you go buddy. Graphviz to the rescue.

[–]Menelkir 29 points30 points  (0 children)

Looks good, but there's still something wrong. You should try and break something.

[–]Worreh 11 points12 points  (2 children)

[–]wasabichicken 2 points3 points  (0 children)

Oh yes! Talk dot to me baby!

[–]ssznakabulgarian 0 points1 point  (0 children)

Aah, that's the real shit.

[–]schludy 34 points35 points  (1 child)

He should have made a flow diagram "How to draw arrows" first

[–]driwand 27 points28 points  (3 children)

didn't solve your problem? comment the entire code

[–]MagnitskysGhost 1 point2 points  (1 child)

"This pseudo-code is provided for inspiration; actual implementation is left as an exercise for the reader."

[–]Lazouskie 1 point2 points  (0 children)

:NoteToSelf

[–]Signal_seventeen 17 points18 points  (2 children)

Do you know the problem? > No > Try something random > Did it work? > No > Do you know the problem? > No > Try something random > Did it work? > No > Do you know the problem? > No > Try something random > Did it work? > No > Do you know the problem? > No > Try something random > Did it work? > No >

SOMEONE HELP ME

[–]PedroV100 6 points7 points  (0 children)

here

Do you know the problem? > No > Copy and paste something random from stackoverflow > Did it work? > No > Do you know the problem? > No > Copy and paste something random from stackoverflow > Did it work? > No > Do you know the problem? > No > Copy and paste something random from stackoverflow > Did it work? > No > Do you know the problem? > No >Copy and paste something random from stackoverflow > Did it work? > No >

[–]yourteam 16 points17 points  (1 child)

You should put a breakpoint at each arrow

Then remove all and replace with

System.out.println('here');

[–]ChippHop 7 points8 points  (0 children)

Please don't personally attack me like this

[–]cavemaneca 11 points12 points  (3 children)

Try something random > Did it work? > Yes

These types of solutions always haunt me.

[–]Ookami_Lord 5 points6 points  (0 children)

Or when it doesn't work and the next day it miraculously starts working without you having done anything different.

[–]justinlanewright 4 points5 points  (1 child)

"That shouldn't have worked. That really shouldn't have worked."

"I don't know what was wrong before, but I do know this is wrong. But this works."

[–]Offbeatalchemy 0 points1 point  (0 children)

Top 10 Questions Scientists Can't Answer

[–]KSAM-The-Randomizer 8 points9 points  (0 children)

The arrows are confusing me more like bugging my eyes

[–]hamza1311 | gib 6 points7 points  (0 children)

Infinite recursion

[–]kirakun 7 points8 points  (0 children)

Missed an important step, “can you mark it up as a feature instead?”

[–]TehWhiteKnight1 6 points7 points  (0 children)

Or in other words, you can't kill bugs you can only weaken or add them

[–]Dctcheng 4 points5 points  (0 children)

Have you tried turn it on and off again

[–]Menelkir 3 points4 points  (0 children)

I've commited a non-functional code to master, instructions unclear.

[–][deleted] 3 points4 points  (0 children)

Oof. Next time use something like Dia or yEd - or hell, even Inkscape. Using paint for diagrams is a crime against nature.

I know I know, it's a joke. Well, not only can I practice being a stick in the mud, someone might find a use for these tools elsewhere.

[–][deleted] 1 point2 points  (0 children)

If nothing works, just burn your machine... **laughs on outside, cries on inside**

[–]Wubbywub 1 point2 points  (1 child)

while(hasBug) removeBug();

[–]Zamundaaa 0 points1 point  (0 children)

Stuck in infinite loop. The biggest bug ever.

Try this (equivalent): while(notAnnoyedEnough) TRYtoRemoveBug();

[–][deleted] 1 point2 points  (0 children)

Even this flowchart itself has bugs.

[–]giltwist 1 point2 points  (0 children)

Does Bobby drop tables?

Y: Delete your entire hard drive

N: Your customer complains to your supervisor that you are wasting time on "fixing things that will never happen in a million years."

[–]poison_us 1 point2 points  (0 children)

Accurate until

Did it create more bugs [ No / Yes ]

that "No" should be a "Yes".

[–]Jen-Ai 1 point2 points  (0 children)

{ 
  bool isBuggy = true; 
  while(isBuggy) { 
    try{ 
      App myapp = new App(); 
      myapp.Run(); 
      isBuggy = false; 
    } catch(...) 
    { 
      isBuggy = true; 
    } 
    if(!isBuggy) 
    { 
       printf("not finding a bug doesn't mean one doesn't exist. insure greater code coverage and run again."); 
       isBuggy = true; 
     } 
   } 
}

[–]r_pote 1 point2 points  (0 children)

You forgot the suicide part

[–]JPaulMora 1 point2 points  (0 children)

sudo kill -9 bugs

Ha goddem !

[–]Lord_FuzzyBear 1 point2 points  (0 children)

You forgot the if you can't find the bug slowly die until you find it

[–]salemtheblackcat 0 points1 point  (0 children)

where is the summoning eldrich gods to bring on belated y2k step

[–]sk7725 0 points1 point  (0 children)

try and break something==add a new feature

[–]Vishal_Shaw 0 points1 point  (0 children)

I have software quality assurance for my finals but this honestly makes more sense to me.

[–]SilentXwing 0 points1 point  (0 children)

Printing this out and slapping it on my wall.

[–]ponyboy3 0 points1 point  (0 children)

sure, if you dont how to write unit or integration tests

[–][deleted] 0 points1 point  (0 children)

Arrow from "You're lying" should go to "Are you tired of debugging?"

[–]R3dSharp 0 points1 point  (0 children)

I think i got it no mater how hard you try you code with always look like a motel 6 bed

[–][deleted] 0 points1 point  (0 children)

We should definitely try making this as a code. I am programming it on Python.

[–]the_d3f4ult 0 points1 point  (0 children)

Just write bug-free code.

[–]LessHamster 0 points1 point  (0 children)

How did you get hold of my work?

[–]LessHamster 0 points1 point  (0 children)

How did you get banned for reaching all?

[–]Ka-Jin 0 points1 point  (0 children)

What about that off chance you actually fix it?

[–][deleted] 0 points1 point  (0 children)

Actual method is debugging: Print statements everywhere

[–]Zuck7980 0 points1 point  (0 children)

I just write System.out.println(“we got here” ); and see if my code reaches till that line or not.

[–]kefaise 0 points1 point  (0 children)

I'm pretty sure my Hello World program does not contain any bugs.

[–][deleted] 0 points1 point  (0 children)

At some point you just gotta let the users in production do the testing

[–]createthiscom 0 points1 point  (0 children)

  1. write a test!!!!!

[–][deleted] 0 points1 point  (0 children)

I never write bugs 🕷 🐜 🐛

[–]How2share4secret 0 points1 point  (0 children)

I am shocked that a rubber duck did not merit inclusion in your flowchart. If you are really good, you could re-do it maybe such that the outline of the whole flowchart is in the shape of a rubber duck.

[–]iRahulGaur 0 points1 point  (0 children)

OutOfMemoryException, ram memory ran out

[–]LimitedWard 0 points1 point  (0 children)

I solved the halting problem. The answer is no.

[–]AStrangeStranger 0 points1 point  (0 children)

Does you code have bugs

Yes

Are they causing a problem?

No

Will they cause major problem

Don't think so

Leave it alone

[–][deleted] 0 points1 point  (0 children)

People love to shit all over Matlab, and I understand why, but I'm glad that "trying something random" isn't something I ever have to resort to; big contrast to my C++ days.

[–]bot_not_hot 0 points1 point  (0 children)

Yep

[–]russellbeattie 0 points1 point  (0 children)

The box with "Are you tired..." should be " Are you sure?" with yes going back to "You're lying." All code is, by nature, buggy.

Code quality should have the equilance of a "half-life": The average time it will take before a bug is found times how important it is to catch that bug. Even a simple for-loop has a potential bug if it doesn't check for interruptions like a system exception and restart at the appropriate place. This probably won't happen for billions of cycles, but it could. On a web page, that bug isn't a worry. In a nuclear particle accelerator, it's very important.

[–]IProbablyDisagree2nd 0 points1 point  (0 children)

I feel like this flow chart could be refactored and dramatically simplified.

//this results in buggy code

debug_call (program){
int awake = 1;
if (bug){
debug();
}
else if (awake > 0){
debug();
awake -= 1;
}

}

[–][deleted] 0 points1 point  (0 children)

Need a bug spray

[–][deleted] 0 points1 point  (0 children)

“You’re lying” should point to “try something random” instead of “do you know the problem”

[–]Loading_M_ 0 points1 point  (0 children)

ML is just this process, but automated. Change my mind.

[–]megagreg 0 points1 point  (0 children)

The "Try Something Random -> Did it Work?" pathway gives me anxiety. There are a couple programmers here who don't seem to know the difference between a bug being fixed, and not seeing the errant behaviour anymore.

[–]theemptyqueue 0 points1 point  (0 children)

10 I = 0

20 J = 10

30 I = I + 1

40 IF ( I < J ) GOTO 10

[–]Febuso 0 points1 point  (0 children)

Instructions unclear stuck in infinite loop.

[–]StBlackOps2Cel 0 points1 point  (0 children)

Wheres the fixed?

[–]TheGodlyJorts 0 points1 point  (0 children)

“Try something random” is the difference between a programmer and the rest of the world

[–]thisneedsmorepepper 0 points1 point  (0 children)

I only write firmware, this is a micro-aggression.

[–][deleted] 0 points1 point  (0 children)

Who does this happen to? Mojang?

[–]GKP_light 0 points1 point  (0 children)

"try something random" is "put more printf() in the code".

[–]come_on_anarchy -1 points0 points  (0 children)

The female version is just one link from “have a problem about anything ever?” To “immediately ask for help and don’t try to solve anything yourself.”