• Cargon@lemmy.ml
      link
      fedilink
      arrow-up
      9
      ·
      1 year ago

      Indices vs offsets. A lot of people mistake the two because they took CS 101 and thought it was so cool to say I sTaRt cOuNtInG fRoM zErO.

    • darcy
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      1 year ago

      bro has never heard of a joke

    • macniel@feddit.de
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      But length of container gives you for example 3, and it has a size of 4. Explain that.

      • TonyTonyChopper@mander.xyz
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        length measures the spaces between the spaces between your fingers, so you can fit 3 balls between the 4 balls between your fingers

    • spauldo@lemmy.ml
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      Also indexes. Once you’ve been bitten enough by off-by-one errors this actually becomes a pretty handy double-check.

      • darcy
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        indexes in memory can be thought of as the address of the leftmost bit in a byte (container)

        • spauldo@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          Sorry, too busy counting digital outputs on Modicon PLCs to think about that stuff.