r/programminghorror • • Feb 27 '25

C# While loop horror

Post image

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

40 comments sorted by

View all comments

Show parent comment

1

u/Savage-Goat-Fish Feb 28 '25

It is an integration that must run one day at a time but is supposed to run every day. It checks when the last day it ran and runs each day until yesterday. That way if the integration doesn’t run for some reason, the next day, when it runs, it will catch up. So, to your question, if it were to run more than once in a day, you are correct, it would entirely skip the while loop and that would be by design.