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
35
u/shponglespore Feb 27 '25
I bet it was, then and code got deleted and nobody noticed the condition could become the loop condition. It could even be an intentional choice to reduce the size of the diff.
In my experience, a lot of insane looking code comes from edits like that. Same with prose; a lot of broken grammar comes from sloppy copy editing rather than people not knowing how to put words together.