▲ 333 ▼ Why make it complicated? (lemmy.ml) submitted 1 year ago* by HiddenLayer555@lemmy.ml to c/programmer_humor@programming.dev 123 comments fedilink hide all child comments Made with KolourPaint and screenshots from Kate (with the GitHub theme).
[–] tisktisk@piefed.social 15 points 1 year ago (12 children) I've always wondered where all this 'let' business started permalink fedilink source hideshow 12 child comments replies: [–] HiddenLayer555@lemmy.ml [S] 30 points 1 year ago* (9 children) It's commonly used in math to declare variables so I assume programming languages borrowed it from there. permalink fedilink source parent hideshow 9 child comments replies: [–] chaos@beehaw.org 7 points 1 year ago (1 child) 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. permalink fedilink source parent hideshow 1 child comment replies: [–] rooroo@feddit.org 1 point 1 year ago Unless you’re in JS. permalink fedilink source parent [–] bandwidthcrisis@lemmy.world 6 points 1 year ago (6 children) 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. permalink fedilink source parent hideshow 6 child comments replies: [–] HiddenLayer555@lemmy.ml [S] 8 points 1 year ago* (5 children) Doesn't Basic use Dim a As String? permalink fedilink source parent hideshow 5 child comments replies: [–] dan@upvote.au 10 points 1 year ago* (4 children) Older variants used DIM for arrays and LET for other variables. DIM was originally called that because it was setting the dimensions of the array. In modern BASIC variants, DIM has become a backronym: "declare in memory". permalink fedilink source parent hideshow 4 child comments replies: [–] sbv@sh.itjust.works 5 points 1 year ago In modern BASIC variants, DIM has become a backronym: “declare in memory”. TIL. I always thought it was a backronym for declare in (yo) momma. permalink fedilink source parent [–] tisktisk@piefed.social 4 points 1 year ago TIL Backronyms and cuil BASIC technicalities Much obliged all permalink fedilink source parent [–] marcos@lemmy.world 2 points 1 year ago (1 child) Even older variants required both a let to declare the variable and a dim to set its size. I remember a REDIM command, but I really can't remember what basic it's from. permalink fedilink source parent hideshow 1 child comment replies: [–] dan@upvote.au 2 points 1 year ago The first programming language I used was Visual Basic (both VBA in Excel, and VB3 then VB6). I think it used redim to resize arrays. permalink fedilink source parent [–] normalexit@lemmy.world 18 points 1 year ago (1 child) More than you'd ever want to know: https://en.m.wikipedia.org/wiki/Let_expression permalink fedilink source parent hideshow 1 child comment replies: [–] tisktisk@piefed.social 6 points 1 year 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 permalink fedilink source parent
[–] HiddenLayer555@lemmy.ml [S] 30 points 1 year ago* (9 children) It's commonly used in math to declare variables so I assume programming languages borrowed it from there. permalink fedilink source parent hideshow 9 child comments replies: [–] chaos@beehaw.org 7 points 1 year ago (1 child) 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. permalink fedilink source parent hideshow 1 child comment replies: [–] rooroo@feddit.org 1 point 1 year ago Unless you’re in JS. permalink fedilink source parent [–] bandwidthcrisis@lemmy.world 6 points 1 year ago (6 children) 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. permalink fedilink source parent hideshow 6 child comments replies: [–] HiddenLayer555@lemmy.ml [S] 8 points 1 year ago* (5 children) Doesn't Basic use Dim a As String? permalink fedilink source parent hideshow 5 child comments replies: [–] dan@upvote.au 10 points 1 year ago* (4 children) Older variants used DIM for arrays and LET for other variables. DIM was originally called that because it was setting the dimensions of the array. In modern BASIC variants, DIM has become a backronym: "declare in memory". permalink fedilink source parent hideshow 4 child comments replies: [–] sbv@sh.itjust.works 5 points 1 year ago In modern BASIC variants, DIM has become a backronym: “declare in memory”. TIL. I always thought it was a backronym for declare in (yo) momma. permalink fedilink source parent [–] tisktisk@piefed.social 4 points 1 year ago TIL Backronyms and cuil BASIC technicalities Much obliged all permalink fedilink source parent [–] marcos@lemmy.world 2 points 1 year ago (1 child) Even older variants required both a let to declare the variable and a dim to set its size. I remember a REDIM command, but I really can't remember what basic it's from. permalink fedilink source parent hideshow 1 child comment replies: [–] dan@upvote.au 2 points 1 year ago The first programming language I used was Visual Basic (both VBA in Excel, and VB3 then VB6). I think it used redim to resize arrays. permalink fedilink source parent
[–] chaos@beehaw.org 7 points 1 year ago (1 child) 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. permalink fedilink source parent hideshow 1 child comment replies: [–] rooroo@feddit.org 1 point 1 year ago Unless you’re in JS. permalink fedilink source parent
[–] bandwidthcrisis@lemmy.world 6 points 1 year ago (6 children) 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. permalink fedilink source parent hideshow 6 child comments replies: [–] HiddenLayer555@lemmy.ml [S] 8 points 1 year ago* (5 children) Doesn't Basic use Dim a As String? permalink fedilink source parent hideshow 5 child comments replies: [–] dan@upvote.au 10 points 1 year ago* (4 children) Older variants used DIM for arrays and LET for other variables. DIM was originally called that because it was setting the dimensions of the array. In modern BASIC variants, DIM has become a backronym: "declare in memory". permalink fedilink source parent hideshow 4 child comments replies: [–] sbv@sh.itjust.works 5 points 1 year ago In modern BASIC variants, DIM has become a backronym: “declare in memory”. TIL. I always thought it was a backronym for declare in (yo) momma. permalink fedilink source parent [–] tisktisk@piefed.social 4 points 1 year ago TIL Backronyms and cuil BASIC technicalities Much obliged all permalink fedilink source parent [–] marcos@lemmy.world 2 points 1 year ago (1 child) Even older variants required both a let to declare the variable and a dim to set its size. I remember a REDIM command, but I really can't remember what basic it's from. permalink fedilink source parent hideshow 1 child comment replies: [–] dan@upvote.au 2 points 1 year ago The first programming language I used was Visual Basic (both VBA in Excel, and VB3 then VB6). I think it used redim to resize arrays. permalink fedilink source parent
[–] HiddenLayer555@lemmy.ml [S] 8 points 1 year ago* (5 children) Doesn't Basic use Dim a As String? permalink fedilink source parent hideshow 5 child comments replies: [–] dan@upvote.au 10 points 1 year ago* (4 children) Older variants used DIM for arrays and LET for other variables. DIM was originally called that because it was setting the dimensions of the array. In modern BASIC variants, DIM has become a backronym: "declare in memory". permalink fedilink source parent hideshow 4 child comments replies: [–] sbv@sh.itjust.works 5 points 1 year ago In modern BASIC variants, DIM has become a backronym: “declare in memory”. TIL. I always thought it was a backronym for declare in (yo) momma. permalink fedilink source parent [–] tisktisk@piefed.social 4 points 1 year ago TIL Backronyms and cuil BASIC technicalities Much obliged all permalink fedilink source parent [–] marcos@lemmy.world 2 points 1 year ago (1 child) Even older variants required both a let to declare the variable and a dim to set its size. I remember a REDIM command, but I really can't remember what basic it's from. permalink fedilink source parent hideshow 1 child comment replies: [–] dan@upvote.au 2 points 1 year ago The first programming language I used was Visual Basic (both VBA in Excel, and VB3 then VB6). I think it used redim to resize arrays. permalink fedilink source parent
[–] dan@upvote.au 10 points 1 year ago* (4 children) Older variants used DIM for arrays and LET for other variables. DIM was originally called that because it was setting the dimensions of the array. In modern BASIC variants, DIM has become a backronym: "declare in memory". permalink fedilink source parent hideshow 4 child comments replies: [–] sbv@sh.itjust.works 5 points 1 year ago In modern BASIC variants, DIM has become a backronym: “declare in memory”. TIL. I always thought it was a backronym for declare in (yo) momma. permalink fedilink source parent [–] tisktisk@piefed.social 4 points 1 year ago TIL Backronyms and cuil BASIC technicalities Much obliged all permalink fedilink source parent [–] marcos@lemmy.world 2 points 1 year ago (1 child) Even older variants required both a let to declare the variable and a dim to set its size. I remember a REDIM command, but I really can't remember what basic it's from. permalink fedilink source parent hideshow 1 child comment replies: [–] dan@upvote.au 2 points 1 year ago The first programming language I used was Visual Basic (both VBA in Excel, and VB3 then VB6). I think it used redim to resize arrays. permalink fedilink source parent
[–] sbv@sh.itjust.works 5 points 1 year ago In modern BASIC variants, DIM has become a backronym: “declare in memory”. TIL. I always thought it was a backronym for declare in (yo) momma. permalink fedilink source parent
[–] tisktisk@piefed.social 4 points 1 year ago TIL Backronyms and cuil BASIC technicalities Much obliged all permalink fedilink source parent
[–] marcos@lemmy.world 2 points 1 year ago (1 child) Even older variants required both a let to declare the variable and a dim to set its size. I remember a REDIM command, but I really can't remember what basic it's from. permalink fedilink source parent hideshow 1 child comment replies: [–] dan@upvote.au 2 points 1 year ago The first programming language I used was Visual Basic (both VBA in Excel, and VB3 then VB6). I think it used redim to resize arrays. permalink fedilink source parent
[–] dan@upvote.au 2 points 1 year ago The first programming language I used was Visual Basic (both VBA in Excel, and VB3 then VB6). I think it used redim to resize arrays. permalink fedilink source parent
[–] normalexit@lemmy.world 18 points 1 year ago (1 child) More than you'd ever want to know: https://en.m.wikipedia.org/wiki/Let_expression permalink fedilink source parent hideshow 1 child comment replies: [–] tisktisk@piefed.social 6 points 1 year 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 permalink fedilink source parent
[–] tisktisk@piefed.social 6 points 1 year 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 permalink fedilink source parent