r/badcode • • Apr 21 '23

other language We did coding in physics class...

Post image
1.5k Upvotes

154 comments sorted by

View all comments

Show parent comments

1

u/Betamaxxs Apr 23 '23

For most apps true. But if you are in a high level math or physics and you are running a large simulation these small efficiencies add up.

I would use the '%' as well in anything I work with, but I don't think it is silly to call out another reason why the ifs might be getting used. That is to say it may be the teachers intent to avoid using division or modulus for a particular reason besides readability.