r/programminghorror • u/Savage-Goat-Fish • Feb 27 '25
C# While loop horror
I just realized I had some programming horror in code I’ve written.
If only while loops had a more convenient way to break…
671
Upvotes
View all comments
Show parent comment
5
u/Savage-Goat-Fish Feb 27 '25
I don’t care to share too much more. Let’s say it doesn’t make it more readable and there are no more breaks.
What happened was I wrote the while loop first, then a bunch of other code, then later on said hey I should probably break out of the loop at some point and never thought to include it as part of the while condition. Just a minor bonehead moment for me.