You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my opinion, whenever a number is divided by 2 or 2 and another number are multiplied together, then it is (almost?) always clear what is meant, and therefore it shouldn't be considered a magic number.
Trying to avoid it being considered a magic number with something like the following seems worse than leaving it as 2:
The
2
is considered a magic number in the following code.In my opinion, whenever a number is divided by
2
or2
and another number are multiplied together, then it is (almost?) always clear what is meant, and therefore it shouldn't be considered a magic number.Trying to avoid it being considered a magic number with something like the following seems worse than leaving it as
2
:That said, I think that something like this should still be counted as a magic number:
(I'm using the named return value form, so that the examples actually produce error messages, given #11 is unresolved as I write this.)
The text was updated successfully, but these errors were encountered: