• 0x4E4F@lemmy.rollenspiel.monster
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 year ago

    I remember how confused I was when I first encountered i=i+1… like, what 🤨? How can this be correct, this thing has to be wrong… and then you start seing the logic behind it and you’re like “oooh, yeah, that seems to work… but still, this is wrong on almost every level in math”… and then you grow a bit older and realize that coding has nothing to do with math, instead it’s got everything to do with problem solving. If you like to name your variables peach, grape, c*nt, you can, and if that helps you solve the problem, even better, just make it work, i.e. solve the problem 🤷.

    • 4ce@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      coding has nothing to do with math

      A monad is just a monoid in the category of endofunctors, what’s the problem?

        • 4ce@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          1 year ago

          It’s from a longer quote in “A Brief, Incomplete and Mostly Wrong History of Programming Languages” about the language Haskell:

          1990 - A committee formed by Simon Peyton-Jones, Paul Hudak, Philip Wadler, Ashton Kutcher, and People for the Ethical Treatment of Animals creates Haskell, a pure, non-strict, functional language. Haskell gets some resistance due to the complexity of using monads to control side effects. Wadler tries to appease critics by explaining that “a monad is a monoid in the category of endofunctors, what’s the problem?”

          Some other languages like e.g. Rust also use monads. The point I was trying to make humorously was that many programming languages sometimes do use math concepts, sometimes even very abstract maths (like monads), and while it’s not maths per se, programming and computer science in general can have quite a bit to do with maths sometimes.

          • 0x4E4F@lemmy.rollenspiel.monster
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            1 year ago

            Yeah, I get what you’re trying to say now 😉. Still, they’re mostly used when doing algos, which in real world practical examples is almost never. We do all sorts of repetitive things, like sorting or user input blocks, but new algos is… something that you might do in NASA, CERN, Wall Street, not your every day programming job. Sure, you might optimize a thing or two here and there, but that’s about it 🤷.

    • Julian@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      1 year ago

      I mean, coding does have to do with math, it’s usually just different notation. i = i + 1 in math notation is just i := i + 1.

      • 0x4E4F@lemmy.rollenspiel.monster
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        That’s advanced calculus, and my guess is, those notations were made up to give rise to a new field in math, which has more to do with computers than math, so I don’t think that counts.

          • 0x4E4F@lemmy.rollenspiel.monster
            link
            fedilink
            arrow-up
            0
            arrow-down
            1
            ·
            edit-2
            1 year ago

            Computation theory, but that’s not math as in regular math. It’s just a fancy way of expressing how things inside a computer work, so we can actually make better versions of it. You just have to express it somehow in math terms.

            It’s like saying engineers use math all the time. No, they don’t. We use simple aproximations of what is actually happening to dumb down the problem, cuz, it does the job nicely and no one will notice the difference between what we used, a simple aproximation, and the real thing, a full blown advanced calculus model of the thing we’re working on.