65

Does anyone else get really irritated when they encounter

i = i + 1

Comments
  • 19
    It's the same weird feeling as encountering something like:

    bool isActive;
    if (isActive)
    return true;
    else
    return false;
  • 3
    In JS there are problems with ++ though, due to automatic semocolon insertion. You can still use += 1 though.
  • 0
    @fox8091 still can do += 1
  • 2
    When my university lecturer and his assistant who is a master's cs student does that.i silently get pissed
  • 1
    Makes my shit itch when I see i = i + 1
    I also never use interpreted languages, so I don't really know much about JS problems with pre- or post-incrementing.
    But on group collaborations, I always try to marginalize the guys who use i = i + 1
  • 0
    @moshmage we know the difference, but except when the value of i is used before the increment, they are exactly the same in practice, so we don't care
  • 1
    I'm used to doing this but only because I used to work in a language where i++ doesn't work
  • 1
    @dandel10n
    if (isActive == true)
  • 0
    That's Swift for ya!
  • 0
    Even Assembler has INC option))
    What is that language without ++?
  • 3
    @OrestH @dandel10n how about this? :D

    switch(isActive)
    {
    case true:
    return true;
    break;
    case false:
    return false;
    break;
    default:
    printf("what?\n");
    break;
    }
  • 0
    It's worse when the project's linter is set to prefer that syntax over ++, and the lead insists that's how it should be.
  • 0
    @blackmarket what project? Wtf
  • 0
    @magnusi fits as well =D
  • 0
    @OrestH early C didn't have that
  • 0
    @iam13islucky can't tell you exactly but I can say it's codename was Zeus. Good God the jshintrc file was so full. All kinds a of wacky settings. I don't miss that.
  • 1
    @magnusi should I ever encouter this I will check the git logs, walk up to that persons desk, remove the hdmi cable from one screen, shout: "you'll have to earn this" and walk away.
  • 1
    @dandel10n maybe you should remove both the cables, the computer, the developer and the desk because it has all been contaminated 😀
  • 0
    @magnusi on second thought ... 😂
Add Comment