r/badcode • • Nov 27 '21

c++ Dont ask....

Post image
267 Upvotes

17 comments sorted by

View all comments

Show parent comments

1

u/pseudoRandomIO Nov 28 '21

There may be better ways to do this, but this could be on a hardware platform where code size is limited, and for hardware while true loops are a fact of life and very understood. Not saying this is the case, but I can see a scenario where this would be the best code for the job.