• Inky@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    This post confuses me. Why would code be simpler than the math notation? Both involve symbolic abstraction of basically the same complexity

    • GTG3000@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 years ago

      Math notation is just terrible in general because a lot of it is shorthand made up by someone who likes single-letter variables. A symbol you can’t type, something above, something below.

      A for loop is clear and descriptive.
      Or if you’re feeling fancy, you could go functional with reduce(add, range(0, 5), 0).