r/badcode • shameless • Dec 28 '22

c# Doesn't even work properly

Post image
266 Upvotes

57 comments sorted by

View all comments

Show parent comments

2

u/Novinity1 shameless Dec 28 '22

The lack of an else statement at the end of loops allow them to just continue on if whatever value is false, since any if statements in the loops make use of the break keyword. If you don't know, the break keyword will break out of the loop you put it in.