this post was submitted on 19 Jun 2025
92 points (84.3% liked)

Programmer Humor

24628 readers
888 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

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

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 week ago* (last edited 1 week ago) (2 children)

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

[–] [email protected] 0 points 1 week 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.

[–] [email protected] 0 points 1 week ago (1 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.

[–] [email protected] 0 points 1 week ago* (last edited 1 week ago) (1 children)

Doesn't Basic use Dim a As String?

[–] [email protected] 0 points 1 week ago* (last edited 1 week ago) (3 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".

[–] [email protected] 0 points 1 week 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.

[–] [email protected] 0 points 1 week ago (1 children)

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.

[–] [email protected] 0 points 1 week 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.

[–] [email protected] 0 points 1 week ago

TIL Backronyms and cuil BASIC technicalities Much obliged all