• Inky@lemmy.ca
    link
    fedilink
    arrow-up
    62
    arrow-down
    1
    ·
    2 years ago

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

    • hglman@lemmy.ml
      link
      fedilink
      arrow-up
      82
      arrow-down
      3
      ·
      2 years ago

      Its got to be a relatively small group who knows enough to understand loops and is also afraid of math symbols.

      • karstin@lemmy.world
        link
        fedilink
        arrow-up
        18
        arrow-down
        1
        ·
        2 years ago

        I’m in that group I think. I do like a liiitle bit of coding in some tiny specific progrqmming language in one piece of software that I use. I understand the basics but try to avoid having to do it. But while code is a little scary to me, math is much scarier lol

      • Choco1ateCh1p@lemmy.world
        link
        fedilink
        arrow-up
        8
        arrow-down
        2
        ·
        2 years ago

        I believe this group could be bigger than some may think. I, and the team I work with, work with for loops similar to these on a regular basis. And only one of us has a bachelor’s degree in math. The rest of us don’t really understand the math unless it is applied.

      • Malfeasant@lemmy.world
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        2 years ago

        Those of us born in the 70s… Doing anything with a computer required knowing at least a little programming, so we learned at 8 years old, then when we got to high school/college, we were taught by people who knew nothing about programming because they were already old and didn’t think they needed to learn anything new…

      • DogMuffins@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Maybe not so small?

        I never encountered these math symbols but for loops are like step 3 in any programming language after variables and conditionals

        • stoneparchment@possumpat.io
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          lol, like 2.5% of the USA are programmers and even if we say twice that number have experimented and taken programming classes, that’s like 1 in 20 people who would even have ever encountered a for loop. This nsf report says ~70% of highschoolers have taken Algebra 2 or a more advanced math course, which is when sum notation is usually introduced. I think 70% is a little greater than 5%!

    • sf1tzp@programming.dev
      link
      fedilink
      arrow-up
      9
      arrow-down
      1
      ·
      edit-2
      2 years ago

      Not really sure if this answers your question (I agree with you, ultimately), but here’s my experience:

      At the college I attended, these sigma/pi expressions weren’t taught until the end of Calculus 2, but I wanted to take an Algorithms class - which had calc 2 as a prerequisite.

      I got an exception from my advisor which allowed me to take Algorithms before the pre-req. In my experience, these concepts were easily learned in the context of algorithmic complexity.

      Some might be barred from learning important theory in computer science by “brutal” math classes at university. They might find solace in this post which translates sigma into ‘for’

    • bane_killgrind@lemmy.ml
      link
      fedilink
      arrow-up
      3
      arrow-down
      4
      ·
      2 years ago

      They are the same difficulty level, sure, but that’s like saying f(x) and f’(x) are at the same difficulty level. Coming from one to the other in a process is the difficult part, and the code offers instructions to follow this process.

    • GTG3000@programming.dev
      link
      fedilink
      arrow-up
      2
      arrow-down
      4
      ·
      2 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).

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

        Mathematical notation was designed to be written by hand. It is at least as clear and descriptive as any syntax from a programming language. You’re pretending that the abstraction behind a for loop is somehow less than that behind a sum or product notation.