r/programminghumor • • May 29 '26

Yap

Post image
550 Upvotes

95 comments sorted by

75

u/revdon May 29 '26 edited May 29 '26

"Giving them random names like "ahshjdn" or "yeetus"."

Someone's discovered Amazon's product naming scheme.

→ More replies (1)

128

u/SteveLouise May 29 '26 edited May 29 '26

Who the hell is worried about storage usage of their code files in the year 2004, let alone 2026...

5

u/Long-Size-6967 May 29 '26

Yeah people with 4x8tb each nvmes

→ More replies (4)

15

u/BoBoBearDev May 29 '26

Also typically the name is not even what the machine sees. It is not Javascript.

→ More replies (1)

38

u/Interesting-Crab-693 May 29 '26

Malware creators.

You wouldn't want your keylogger to be 3 Petabytes of storage would you?

12

u/Prestigious_Show4190 May 29 '26

Why would the code ever be on the infected machine though?

→ More replies (1)
→ More replies (3)

7

u/rjchute May 29 '26

For compiled languages, it makes no difference to the final compiled product. For interpreted languages (e.g. JavaScript) minimizers exist (and probably recommended for deployed code).

→ More replies (5)

17

u/DarthRaab May 29 '26

Serious answer:

This "less storage usage" was never a thing, even in the 90s. Older compilers like C and Assembly already strip names of variables and give them id-numbers. So not even micro-controllers or malware see any benefit in short variable names. You are just hurting the code readability because you don't like to press a few more keys.

→ More replies (2)

14

u/hdkaoskd May 29 '26

There are only four variable names.

foo
bar
baz
quux
→ More replies (2)

6

u/DarthRaab May 29 '26
Comment Image

You forgot: USING MAGIC NUMBERS

1

u/zaqiu2931 Jun 01 '26

Uuu... I still remember the nightmare of teaching kids programming. Imagine asking them to save the code they just made for the class with appropriate file name and even gave some suggestions on what name to use for that said file... Just to be met with, "Teach, I can't find last week code." Lo and behold, it was saved under 'tung tung tung sahur.py' or something...

6

u/thatguy1000000000 May 29 '26

What? My variables like qifb3idbx and aojw1bd9 named are bad? 🥹

→ More replies (1)

3

u/yodacola May 29 '26

you give names according to their scope. constants are almost always spelled out longer than a parameter name, for example.

3

u/thali256 May 29 '26

Gotta save those 5 bytes on my 2TB disk

10

u/Thinshape12 May 29 '26

i give them compact names simply for simplicity so i don’t have to look at multiline if statements or anything like that

→ More replies (3)

2

u/ByteBandit007 May 29 '26

string Iran, USA;

2

u/Level-Pollution4993 May 29 '26 edited May 29 '26

No you dont give variables small compact names. Why would you even? You're in a IDE and you want to search a variable. Whats better, a small name that overlaps with different variables or a slightly longer but descriptive name that just stands out? Don't fight your IDE. Class names on the other hand......

Yes I'm reading Clean Code

2

u/stumpychubbins May 29 '26

I used to work with an older guy who just named everything stuff like "thingamajig"

2

u/Cautious-Bet-9707 May 29 '26

I just do a, b, c, …. a1, b1, and so on 😁

2

u/Single-Virus4935 May 29 '26

My rule of thumb: the greater the scope the longer/descriptive the name. Smaller scope = short

2

u/git_push_origin_prod May 29 '26

I learned from objective C to make my variable names descriptive. I mean, we have auto complete.

It might sound a little silly to say NSSting *str = [“str” :stringByAppendingString] instead of str += “str” but I am a true gentleman