• MrMobius @sh.itjust.works
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago

    In a way I always thought coding was more intuitive than maths writing norms. That is if you speak English. If not, it’s as much daunting as weird greek symbols.

  • funkyb@lemmy.world
    link
    fedilink
    English
    arrow-up
    34
    arrow-down
    2
    ·
    1 year ago

    Yea that’s not explained better than a math teach. They just swapped notation common in math, for notation common in one specific programming language. it’s only easier for the audience who happens to be familiar with programming in general, and that language in particular.

    • ipkpjersi@lemmy.one
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      2
      ·
      1 year ago

      I think the concept of a for loop is easier to learn, even for non-programmers, as biased as I may be.

    • KoboldCoterie@pawb.social
      link
      fedilink
      English
      arrow-up
      17
      arrow-down
      1
      ·
      1 year ago

      one specific programming language

      I think you’d be hard pressed to find someone with any sort of programming background, even just as a hobbyist, who doesn’t understand that for loop notation, whether or not they know the specific language it’s from. (I couldn’t even tell you what specific language that’s from, because that notation matches so many different ones.)

      I have a 15 year old son; he definitely has not seen summation in math classes yet, but he has far more than enough programming experience (even just from school) to understand the for loop.

  • ShustOne@lemmy.one
    link
    fedilink
    arrow-up
    27
    ·
    1 year ago

    Maybe I’m crazy but they did teach me this in school. “This means so this operation until conditions are met”.

  • Inky@lemmy.ca
    link
    fedilink
    arrow-up
    95
    arrow-down
    3
    ·
    1 year 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
      6
      arrow-down
      4
      ·
      1 year 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
        ·
        1 year 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.

    • bane_killgrind@lemmy.ml
      link
      fedilink
      arrow-up
      6
      arrow-down
      4
      ·
      1 year 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.

      • Jee@lemmy.fmhy.ml
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        1 year ago

        I mean they are both the exact same thing, I don’t see why summation is scray when the for loop isn’t. It’s the same thing written in a short and easy format.

    • AnarchistArtificer@slrpnk.net
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I’m a subscriber to her YouTube(one of my favourite videos of hers) and she has a bunch of videos aimed at helping game developers learn the maths concepts they need for making games, so her audience is mostly people with a coding background, I’m guessing.

      So it’s less that code is simpler than math notation, more that the maths notation looks scary to people without a maths background, but here’s a link to a different complex symbolic abstraction that you might already know

    • hglman@lemmy.ml
      link
      fedilink
      arrow-up
      111
      arrow-down
      4
      ·
      1 year 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
        19
        arrow-down
        1
        ·
        1 year 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

      • DogMuffins@discuss.tchncs.de
        link
        fedilink
        arrow-up
        30
        arrow-down
        3
        ·
        1 year 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
          16
          arrow-down
          4
          ·
          1 year 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%!

          • kartoffelsaft@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            Huh. When I took Calculus II in community college, the professor introduced sum notation and like 2/3 of the class was like “wow that’s cool I didn’t know about that”. I don’t remember ever being formally taught it before that but it still surprises be how few people where already familiar with it.

          • BeautifulMind ♾️@lemmy.world
            link
            fedilink
            arrow-up
            10
            arrow-down
            1
            ·
            1 year ago

            That’s interesting to hear; somehow my algebra 2 skipped sum notation (and it wasn’t remedially covered in subsequent math classes) but I’ve been writing code for decades now and seeing it in code totally explains the sum notation for me

      • Choco1ateCh1p@lemmy.world
        link
        fedilink
        arrow-up
        11
        arrow-down
        2
        ·
        1 year 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.

      • charlieb@kbin.social
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        I never made it into algebra in grade school, my scores weren’t good enough. but I took a liking to software dev and the ability to create digitally. Self taught myself all the variables and flow controls and OOP, now been a professional developer for 15 years.

        However I still suck at math, and these fancy symbols still scare me probably because they were never properly explained. But yeah, I fit right in the mold you describe. Glad I have the computer to crunch the numbers for me.

      • Malfeasant@lemmy.world
        link
        fedilink
        arrow-up
        7
        arrow-down
        1
        ·
        1 year 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…

      • uskok@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Why not? If you don’t understand a meme it’s perfectly fine to ask for a context or explanation.

    • sf1tzp@programming.dev
      link
      fedilink
      arrow-up
      13
      arrow-down
      1
      ·
      edit-2
      1 year 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’

  • physicswizard@lemmy.ml
    link
    fedilink
    English
    arrow-up
    54
    arrow-down
    1
    ·
    1 year ago

    People who are arguing that one way of expressing these concepts is easier to learn/understand than the other are missing the whole point. Mathematical notation was not designed to teach students how to do math or explain how to design algorithms. It was invented to communicate precise, abstract ideas concisely between mathematicians who already understand what the symbols mean.

    Mathematicians require a notation that has the flexibility to manipulate mathematical objects/symbols in a way that naturally emphasizes their properties and relationships. Often they don’t even care whether the objects they’re studying are even computable or have a numerical representation. They just need them to have certain properties so that they can be manipulated appropriately.

    Discrete sums are a rare example of when the mathematical notation overlaps with the description of an algorithm for computing its value (and the overlap is not even complete; infinite sums are easily represented in math notation but are practically uncomputable when implemented naively). Every other advanced mathematical concept puts a premium on ease of symbol manipulation over computability: integrals, derivatives, matrix multiplication, abstract algebra, etc.

    TL;DR math notation is complex because its intended audience is people who already understand it, want maximum flexibility of symbol manipulation, and historically didn’t really care about practical computation.

    • heimchen@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      15
      arrow-down
      1
      ·
      edit-2
      1 year ago

      You are right the symbols weren’t created so students can learn them, but students have to learn them at one point and for me personally, a student that knows how to program, figuring out that these symbols kind of represent for loops made them easier to understand.

  • horni3000@feddit.de
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    1 year ago

    You can reduce this readable code into one line of confusing python list comprehension that runs 100x slower!

    • hglman@lemmy.ml
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      Yes, the classic readability of c style for loops.

      How about some Haskell

      let numbers = [1, 2, 3, 4, 5] let sumOfNumbers = sum numbers

    • Faresh@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I don’t think you can use python list comprehensions in this case, since you don’t want a new list, but rather reduce it to a single value.

    • 0xff@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      What’s wrong with list comprehensions? Do I just have Stockholm Syndrome at this point?

      I would skip the square brackets and just use a generator expression: sum(3*n for n in range(5)).

  • nanoUFO@sh.itjust.works
    link
    fedilink
    arrow-up
    15
    arrow-down
    1
    ·
    1 year ago

    The hard part of math isn’t understanding esoteric symbols it’s the theory behind it and it’s application. Number theory will mindbreak almost all people.

    • Stan@lemmywinks.com
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      1 year ago

      The hardest thing for me about math was the symbols. Greek, Roman, English.

      Once you get past that, the numbers are easy.

      • nanoUFO@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        ·
        1 year ago

        Number theory and higher levels of math are a completely different beast. Once your exam is over 50% just writing proofs you will change your tune. Unless you are built for it.

  • someacnt@sopuli.xyz
    link
    fedilink
    arrow-up
    26
    arrow-down
    5
    ·
    1 year ago

    Just notational difference other than presence of mutation… How is it harder to understand 3 + 6 + 9 + ... + 3n means compared to the for loop? Is repeated addition hard to grasp?

    • Stan@lemmywinks.com
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      1 year ago

      This thread makes me sad as fuck.

      Obviously you can integrate using Sigma notation, if it’s a definite integral.

    • Kempeth@feddit.de
      link
      fedilink
      arrow-up
      11
      ·
      1 year ago

      No it’s not harder to grasp, just less concise. Summation and Product notation exist for the same reason we don’t say “a discernible but subtle level of humidity” and just use “moist” instead - it’s more convenient. People can be taught to readily understand “moist” or the summation notation. It’s much harder to teach people to read the longer notation more quickly.

  • _number8_@lemmy.world
    link
    fedilink
    arrow-up
    76
    arrow-down
    2
    ·
    1 year ago

    i hate that we all got so frightened about math. it’s genuinely fun to learn how it works when you’re not being forced to in a school setting, which was just a fucking nightmare for no reason. i had this former navy DI lady teacher in gifted kid algebra [so already a year ahead] yell at me for asking questions; she wasn’t going to ‘hold my hand’ thru the homework, which was quite literally her fucking job

    • Duckef@lemmy.ml
      link
      fedilink
      arrow-up
      24
      ·
      1 year ago

      Turning 35 in a month and I’ve just started learning maths again after being afraid of it because of a similar situation to yours.

      • Square Singer@feddit.de
        link
        fedilink
        arrow-up
        6
        arrow-down
        1
        ·
        1 year ago

        It’s surprisingly easy. I used tl give maths tutoring to finance my university degree. What I’d do is let the kids do one exercise task from their school books to see where their difficulties were. While they were on it, I quickly read through the relevant sections in the book, and it was so easy every time that I knew everything I needed to know after a few minutes. Like literally stuff that took weeks at school within minutes.

        School just sucks and makes it really hard to learn anything. Almost everything kids learn at school is actually really easy.

        • veroxii@lemmy.world
          link
          fedilink
          arrow-up
          10
          ·
          1 year ago

          Well it’s harder for them because they are kids and their brains are still developing. You’ve had a lifetime of experiences to draw from where you use math concepts subconsciously many times a day.

          • Square Singer@feddit.de
            link
            fedilink
            arrow-up
            3
            arrow-down
            1
            ·
            1 year ago

            Totally true. They haven’t learned to learn yet, they aren’t learning because they want to, or even because they need what they learned.

            But the point I was trying to make is, that many adults are still afraid (and many even strongly so) of maths, because it was hard for them at school. But it probably wouldn’t be hard for them now.

    • electrogamerman@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Im sorry you had awful teachers, but not all of them are bad. I had amazing teachers that were very worried for the students to learn. In contrast I had very shitty classmates that just didn’t care and would blame the teachers for their laziness.

    • ComradeSharkfucker@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Idk man I’ve been doing my Cal 3 and 4 this semester and fuck me it’s hard. Yeah sure it’s cool sometimes but wrapping my head around it and often trying to think about things geometrically hurts. I sat there for a full hour trying to figure out why I couldn’t picture the equation I was trying to take a triple integral of only to realize it’s 4 dimensional and I almost cried

    • Dohnakun@lemmy.fmhy.mlB
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      1 year ago

      It’s not about being frightened, it’s just that i know only a handful (mostly esoteric) languages with worse syntax.

    • SapphicFemme@lemmygrad.ml
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      edit-2
      1 year ago

      Sorry you were put through that. Aggressions are no place for learning

      My family and school were god awful at teaching. It was all forced (rote memorisation) learning and not me actually learning. I needed things taught slowly and broken down. I have wanted to learn the more advanced technical maths long ago, but now I am an adult and need to find a safe, quite and gentle environment where i can

      anybody reading this, please do not give suggestions or advice in replies. thank you.

      • myslsl@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        1 year ago

        My advice is to keep something to yourself if you don’t want to listen to peoples opinions about it.

    • affiliate@lemmy.world
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      1 year ago

      i completely agree. this sentiment was echoed pretty well in a (nontechnical and accessible) paper i read a few years ago. he says the current approach is like forcing people to learn music, but only teaching them how to read sheet music and not letting them touch any instruments. it hides the creativity and problem-solving of the discipline and reduces it to memorizing formulas.

  • ChrislyBear@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    4
    ·
    edit-2
    1 year ago

    I disagree. It’s a while loop, because a for-loop is finite, so you can’t count to infinity with it.

    • Kempeth@feddit.de
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I wanna see how you get a while loop to actually go to infinity. I’ll wait…

      on second thought, no I won’t.

    • isildun@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      There’s nothing special about a generic for loop (at least in C-like languages). There’s no reason you couldn’t do something like for (i = 0; true; i++) to make it infinite. Some languages even support an infinite list generator syntax like for i in [0..] (e.g. it lazily generates 0, then 1, then 2, etc. on each iteration) so you can use a for-each style loop to iterate infinitely.

      Now, whether or not you should do such things is another question entirely. I won’t pretend there aren’t any instances where it’s useful, but most of the time you’re better off with a different structure.

    • Pitri@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      10
      ·
      1 year ago

      there is no reason for a (non-foreach) for loop to be any more or less finite than a while loop.

      for (a; b; c)
      {
        d;
      }
      

      is just syntactic sugar for

      {
        a;
        while (b)
        {
          d;
          c;
        }
      }
      

      in most or all languages with c-like syntax.