• rockSlayer
    link
    fedilink
    arrow-up
    17
    ·
    1 month ago

    If you like if statements, you’ll love the python case statements for pattern matching

    • partial_accumen
      link
      fedilink
      arrow-up
      38
      ·
      30 days ago

      Ohhh nice! I could see replacing dozens of nested if statements with dozens of nested case statements!

        • partial_accumen
          link
          fedilink
          arrow-up
          3
          ·
          29 days ago

          I remember one of the hardest transitions for me from scripting in Ruby to Python was the whitespace indent was larger by default in Python. With Python, I ran out of monitor width and would have to be constantly scrolling right and left when visually parsing the code because the nested loops were so deep.