Skip to main content
5 events
when toggle format what by license comment
Nov 14, 2017 at 19:39 comment added IMil @Brandin IMHO there was no behaviour change. The original code said basically: (if x+1 >= length then 0 else x+1). The Clever Trick was to rewrite it as ((x+1)%length) . That's exactly the same. The main difference is that the Cleaver Trick is not obvious.
Nov 14, 2017 at 11:08 comment added Brandin A trick is only clever if it works. In this case using % instead of the conditional changes the behavior. The resulting code may be incorrect. Tricky correct code is always better than "clear" incorrect code. Of course, with care, you can achieve clear and correct code.
Nov 14, 2017 at 8:14 comment added CodeMonkey +1 for asking for input before making the change. That can already defuse these kinds of situations before they're happening. Most people with such a strong sense of code ownership will be ok with changes if they can leave their mark or do it together.
Nov 13, 2017 at 11:56 review First posts
Nov 13, 2017 at 12:28
Nov 13, 2017 at 11:55 history answered IMil CC BY-SA 3.0