3 ms·
Sometimes it is. Sometimes not. Don't you think the original question was at least interesting in a pedantic way if not useful in practice? Yes, if you're worr
by statictype 16y ago
Sometimes it is. Sometimes not. Don't you think the original question was at least interesting in a pedantic way if not useful in practice?
Yes, if you're worried about 1==x vs x==1 then you're probably writing code at the wrong level, but it's still a nice thing to investigate and reason about on a purely academic level.
In those cases, skirting the question by saying "You're doing it wrong" adds nothing to the conversation except to pull in a few "Yeah" shouts from the chorus.
- InclinedPlane 16y agoMany people have added to the discussion. The truly correct answer is (as others have pointed out): you shouldn't have to ask. Because if it actually matters to you then you should be using profiling, timing tools, etc. that will make it trivial to figure out which one is faster.