I don’t fully agree this is bad code. This depends a lot on the context like:
is there a company rule that requires every assignment to be documented (in which case the rule itself is the “problem”, not the code)
the name magic number might be very meaningful to everyone working on this project or even the whole industry (I’m not a game dev so I don’t know but I’ve seen the term magic number in other software where people were aware of its meaning)
119
u/[deleted] Jun 09 '20
I don’t fully agree this is bad code. This depends a lot on the context like:
is there a company rule that requires every assignment to be documented (in which case the rule itself is the “problem”, not the code)
the name magic number might be very meaningful to everyone working on this project or even the whole industry (I’m not a game dev so I don’t know but I’ve seen the term magic number in other software where people were aware of its meaning)