minigubben's lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
hairinmybellybutt@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years ago

call the doctor, the CS doctor

lemmy.world

message-square
20
fedilink
235

call the doctor, the CS doctor

lemmy.world

hairinmybellybutt@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years ago
message-square
20
fedilink
  • grue@lemmy.world
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    4
    ·
    2 years ago

    Oh, for fuck’s sake.

    Your thumb is not your zeroth finger; it’s your first finger.

    Starting from zero is for situations when you’re counting the left (or first) edge of containers used to hold items. For example, if you wanted to count the number of balls you could hold in the spaces between your fingers, you start with 0 because the number of balls you can hold between your thumb and {} is 0.

    • Cargon@lemmy.ml
      link
      fedilink
      arrow-up
      9
      ·
      2 years 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@sh.itjust.works
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      2 years ago

      bro has never heard of a joke

    • macniel@feddit.de
      link
      fedilink
      arrow-up
      4
      ·
      2 years 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
        ·
        2 years 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
      ·
      2 years ago

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

      • darcy@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years 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
          ·
          2 years ago

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

    • Phoenix3875@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      There you are, our CS doctor.

    • hairinmybellybutt@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      arrow-down
      3
      ·
      2 years ago

      You’re angry

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 257 users / day
  • 232 users / week
  • 2.52K users / month
  • 4.01K users / 6 months
  • 2 local subscribers
  • 36.4K subscribers
  • 1.75K Posts
  • 36.2K Comments
  • Modlog
  • mods:
  • cat_programmer@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org