42

I find statements such as, `count = count + 1` very annoying >_<

Comments
  • 3
    I think you like short hand assignment operators....
  • 9
    Short hand assignments are just sugar syntax and are not available in all languages, say Lua
  • 2
    Used to do that now I do counter+=1
  • 0
  • 7
    @mr-crazyhacker no cunt++;
  • 3
    I prefer count++ or ++count depending on the use case. Or, count += x
  • 4
  • 2
    depends on used compiler, possible side effects at runtime etc
  • 1
    Depends on the code. Sometimes writing an additional line makes it more readable
  • 1
    count = count + 1 or count += 1 is definately better practise on javascript than count++ or ++count depending on douglas crockford's opinions
  • 0
    count = count + 1 feels more readable to me. Anything to reduce cognitive load while reading code.
  • 2
    @Orek Douglas Crockford is legendary!
  • 1
    @JsonC11 JsLint <3
  • 0
    @Orek meh. I take everyone's opinion with a grain of salt, and I don't get why people wouldn't like ++. It literally does one thing, increment. It does it in most languages, and it literally translates to a single statement in assembly.
  • 0
    This rant++
  • 2
    What about the comment before:
    //add 1 to count
  • 1
    That's the problem with ++.. It doesn't just increment. It also returns the previous or new value.
  • 0
    For me is inc(count)
    *cries in corner alone*
Add Comment