I started coding with TurboBasic which allowed variable names of any length but the compiler only looked at the first two letters (and case-insensitive at that), so DOUGHNUT_COUNT and DoobieCounter were actually the same variable. Good times debugging that kind of shit.
Yeah, I was thinking of old 8-bit computers that did the same ignore-after-second-char thing. Most people didn’t bother typing the extra characters though because 1) those characters took up valuable memory and 2) if you accidentally put a keyword in the middle of your longer name, the tokeniser would see it and assume it was a keyword.
e.g. Calling your variable FORGET seemed like a good idea until you got a syntax error because FOR and GET are both keywords. FO it is, then. Or just F.
COLOR was cursed too; OR is usually a keyword, even if COLOR itself isn’t. British English COLOUR might save you here, but you’re still losing those four extra bytes.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
I started coding with TurboBasic which allowed variable names of any length but the compiler only looked at the first two letters (and case-insensitive at that), so DOUGHNUT_COUNT and DoobieCounter were actually the same variable. Good times debugging that kind of shit.
Yeah, I was thinking of old 8-bit computers that did the same ignore-after-second-char thing. Most people didn’t bother typing the extra characters though because 1) those characters took up valuable memory and 2) if you accidentally put a keyword in the middle of your longer name, the tokeniser would see it and assume it was a keyword.
e.g. Calling your variable
FORGET
seemed like a good idea until you got a syntax error becauseFOR
andGET
are both keywords.FO
it is, then. Or justF
.COLOR
was cursed too;OR
is usually a keyword, even ifCOLOR
itself isn’t. British EnglishCOLOUR
might save you here, but you’re still losing those four extra bytes.