• glibg10b@lemmy.ml
      link
      fedilink
      arrow-up
      27
      arrow-down
      3
      ·
      1 year ago

      Well, it’s wrong. The only difference between the two kinds of loops is that do-while starts by unconditionally running the body once

      • KTVX94@lemmy.myserv.one
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Yes, that’s true. It’s also good enough to make an abstract concept more approachable while getting a kick out of it too. Honestly this is more of a “well akcshually” thing that someone who already knows how this works would point out (nobody has so far) than something that misleads students who don’t get it. It works.

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      11
      ·
      1 year ago

      Please switch over to something that actually has a condition that needs to logically be evaluated on each step and not as an end condition - yes this meme is technically correct for the case where they both start adjacent to the cliff and programmers should always consider (cliff) edge cases… but the visual strongly implies they’ve been running for a while.

      • KTVX94@lemmy.myserv.one
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I mean yeah, it does have that problem, but even if it’s not entirely accurate it’s good enough to illustrate an otherwise abstract concept that’s not exactly easy to understand for someone who’s just getting started with programming and may not really be interested in it, rather looking to be an artist or game designer. Also humor really helps when it comes to learning. It does way more good than bad in my experience so far.