3 ms·
Whether an extra variable is better than an extra conditional is mostly a matter of taste. Yours gets the job done too.
by thaumaturgy 12y ago
Whether an extra variable is better than an extra conditional is mostly a matter of taste. Yours gets the job done too.
- mapimopi 12y agoWhy not just if (i % 3 != 0 && i % 5 != 0) this extra boolean variable out?
- ivanche 12y agoI like to think it's matter of readability. "if (pureNumber)" vs. "if (i % 3 != 0 && i % 5 != 0)". Also, one extra variable vs. reversal of already mentioned condition. Yes, we're splitting hair here :)