Made with KolourPaint and screenshots from Kate (with the GitHub theme).

    • HiddenLayer555@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      25
      arrow-down
      1
      ·
      edit-2
      14 days ago

      It’s commonly used in math to declare variables so I assume programming languages borrowed it from there.

      • chaos@beehaw.org
        link
        fedilink
        arrow-up
        7
        ·
        14 days ago

        More specifically, they’re borrowing the more mathematical meaning of variables, where if you say x equals 5, you can’t later say x is 6, and where a statement like “x = x + 1” is nonsense. Using “let” means you’re setting the value once and that’s what it’s going to remain as long as it exists, while “var” variables can be changed later. Functional languages, which are usually made by very math-y people, will often protest the way programmers use operators by saying that = is strictly for equality and variable assignment is := instead of == and = in most C-style languages.

      • bandwidthcrisis@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        14 days ago

        BASIC uses (used?) it to declare variables. (I don’t know if earlier languages did.)

        Not that that’s a reason for other languages to copy it.

      • tisktisk@piefed.social
        link
        fedilink
        English
        arrow-up
        6
        ·
        14 days ago

        I doubted you until I got about halfway through this whole page. I concede tho–you are most correct lol Still a decent read and for that I thank you