The audacity to do such a thing…

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

      Would one not just use a dict/hashmap with int keys labelling lengths and the list of strings as the values?

        • QuazarOmega@lemy.lol
          link
          fedilink
          arrow-up
          17
          arrow-down
          1
          ·
          2 years ago

          I like the implication that programmers aren’t humans, but a sort of alien being naturally apt at algorithmic thinking, while puny humans are an irrational species that needs to undergo training from the mighty race of programmers if they hope to get into the field brought us here by the aliens

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

          ‘List’ is the correct abstract term for any data structure that holds a given number of values in an order, regardless of the implementation. So Python’s List, or C++'s Array or Vector, or a Linked List are all considered lists in the abstract sense.

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

          I did use ‘list’ and forgot it is called an ‘array’ or ‘vector’ in other languages. So sure, close enough :-)

    • wethegreenpeople@sopuli.xyz
      link
      fedilink
      arrow-up
      6
      ·
      2 years ago

      This makes a ton of sense and I think you probably solved this mystery for me.

      “Oh I need to iterate over something, and keep track of new information as I do it, therefore I should be able to create ‘dynamic variables’ as I progress.”

      • wewbull@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        2 years ago

        Yep, what you failed to realise at the time is you’ve just invented a dynamic data structure like a list or a dictionary.