tucson.social
  • Communities
  • Create Post
  • Create Community
  • 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
15
link
fedilink
220

call the doctor, the CS doctor

lemmy.world

hairinmybellybutt@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years ago
message-square
15
link
fedilink
  • grue@lemmy.world
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    3
    ·
    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
      8
      ·
      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.

    • 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
      2
      ·
      2 years ago

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

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

      There you are, our CS doctor.

    • hairinmybellybutt@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      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: [email protected]

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.

  • 92 users / day
  • 1.86K users / week
  • 3.11K users / month
  • 9.5K users / 6 months
  • 2 local subscribers
  • 35.9K subscribers
  • 1.71K Posts
  • 31.7K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org