10

People can judge you between i++ and i+=1

Comments
  • 3
    @PublicByte And yet by writing this you wasted more time than you saved
  • 0
    Also

    void increment(int n) {
    return n+1;
    }
  • 0
  • 0
    @s0LA Would it even matter whether it's ++i or i++ if you're not assigning the value to another variable?
  • 0
    Can also be a sign of when you came up and where, kind of like how some people still religiously put the constant on the left side of comparisons bc C. For this instance, Actionscript for example had cases where i+=1 would be significantly faster after compilation, and cases where it would be slower. Just historical leftovers.
  • 0
    @s0LA Well, at my job I often do i++ without problems, though I did find some cases where i++ was a problem and I really needed ++i, indeed.
  • 0
    This won't be applied for Python though.
Add Comment