What's so bad about using infinite loops?

So I was on some non-FRC code in C, and while testing a specific feature I accidentally left an infinite loop that printed to stdout, which was redirected to a file.
This is the result of the code running for around a minute (before I shut it down via Task Manager):

More than 16 million lines

image

File size is almost 0.5GB

image
(the output file is t1_out.txt).

I might show this to next year’s new programmers as an example of why loops need caution.

I hope everyone found an answer to the rhetorical/sarcastic title.

5 Likes

Seeing the title i thought you were asking a serious question. So glad you weren’t XD

But still… 16 million lines! Wow!

5 Likes

Reminds me of this: Are loops ok in FRC Programming

Reposted from Discord:
The team that ran out of code.

That story is also on CD here, and this meme was made about it.

1 Like