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
Given the code above, Simplify will tell the user to change oneDay to oneDay = nbOfSecondsInADay, which users feels is surprising and/or less readable.
I'm therefore wondering whether we should remove this simplification. I think we could still remove code like 1 * 1 as I'm having a lot more trouble imagining a situation where that is needed.
I think keeping 1 */* 1 prevents us from doing some simplifications (like n == 1 * n -> n == n -> True), although I believe we could special-case 1 * to be ignored in these situations.
The text was updated successfully, but these errors were encountered:
Multiplication by 1 is one of the first and common complaints about this rule.
Here's an example of where people would like to keep it
Given the code above,
Simplify
will tell the user to changeoneDay
tooneDay = nbOfSecondsInADay
, which users feels is surprising and/or less readable.I'm therefore wondering whether we should remove this simplification. I think we could still remove code like
1 * 1
as I'm having a lot more trouble imagining a situation where that is needed.I think keeping
1 *
/* 1
prevents us from doing some simplifications (liken == 1 * n
->n == n
->True
), although I believe we could special-case1 *
to be ignored in these situations.The text was updated successfully, but these errors were encountered: