• Cargon
      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.

    • 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
      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.

        • spauldo
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

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