61

Cause for us counting starts with 0. (in most of programming languages)

Comments
  • 23
    x[3] doesn't mean take the 3rd apple.

    x[3] means skip 3 apples and then take one.

    x[0] means skip 0 apples and then take one.
  • 11
    Third apple is at index 2. Fourth apple is at index 3. Cmon now.
  • 1
    0th apple always tastes the best
  • 1
    what if I don't like apples
  • 0
    I wish we got rid of st nd th don't need them 😋
  • 5
    No, thats the 4th apple at index 3.
  • 2
    I was gonna make the comment about it being the 4thh apple... :( but it seems repetitive now
  • 1
    Damn it guys...

    I wanted to nitpick him on array indexes first!

    And I asked for oranges damn it! ORANGES!

    Can't our front end guy get it right?
  • 0
    It isn't the third apple...it's the fourth apple, of index 3
  • 1
    Indexing, not counting starts at 0.
  • 1
    It's the fourth apple on the index 3
  • 0
  • 0
    @ac1235 wow, didnt know that. Wtf always thought that you simply start counting from zero.
  • 1
    This is my least favourite kind of programming humour
  • 1
    @Jifuna it is a valid way to think about it, but when you look how it is implemented in C:
    X is the (pointer to the) first apple
    so is X[0]=X+0
    But when we skip the first: X[1] = X+1 we get the second apple. and so on
  • 0
    @ac1235 ah, I understand. Now that I think about it that very logical. Thx.
Add Comment