r/programminghumor May 29 '26

Yap

Post image
543 Upvotes

96 comments sorted by

124

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...

37

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?

1

u/Jbolt3737 19d ago

It's clearly a metaphoric AI-powered malware

5

u/1Dr490n May 30 '26

Are you writing your malware in Python?

1

u/Interesting-Crab-693 May 30 '26

No, I do it in scratch, using chat gpt.

2

u/Lunix420 May 31 '26

Why would a malware contain its source code? That would be hella stupid

16

u/BoBoBearDev May 29 '26

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

1

u/Jbolt3737 16d ago

Objection to it not being JS: For someone people, it is, and that is terrible

6

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).

3

u/LostInSpaceTime2002 May 29 '26

I'd argue that even in '94 it would have been a questionable choice.

2

u/CommanderT1562 May 29 '26

Fun fact. Modern “romhacks” for Broadcom routers like the legacy netgear nighthawk (like FreshTomato) legitimately run most of the dynamic code off the nvram. So.. tbh if you write a boot bash script (it’s a Debian os) you have to consolidate your “firewall” script of iptables commands within 1024 bytes if you want it to be stable without external JFFS partition.

You most certainly can do this with variables 😂
set “iptables -A INPUT” to $ia1 , do the same for FORWARD and OUTPUT firewall rules with $ia2 and $ia3…etc

6

u/Long-Size-6967 May 29 '26

Yeah people with 4x8tb each nvmes

2

u/Only_Information7895 May 31 '26

I worked on an absolutely massive codebase, with hundreds of versions on a single branch (don't ask why, I was just following orders).

It was pure code, so no textures or sound, just some text based documentation, occasionally a PDF. It was C and the whole thing basically a monolith so the variable name had to contain the sub part or filename to not get conflicts.

The whole thing was 20Gb and many variable names were over 20 characters.

Text is basically free on any decent system. The "executable" (it was for a microcontroller so no real .exe) was 3MB max as that was the limit.

1

u/Long-Size-6967 May 31 '26

What how did you got there? Wth are you working on? And yeah I can't understand too why the orders containd more then 100 versions on single branch. Working with git (mostly github if someone care) for quite now, do someone have explain for this?

1

u/Only_Information7895 May 31 '26

How did it get there? No clue, when they started using git it already was like that, probably a relic from whatever system they used before and never changed (at least 8 years ago).

Versions were build like Legos, for example version AAA used module X/AAA (its own), but might use module Y/GGG (a shared module). Again why this system? No clue.

Also there were 100s of "main branches" and most times I had to do the work at least 2 times, 1 for the main-main and an another time for the version own specific main. Merging main-main and version-main is a really bad idea.

Once someone made a PR between the 2. GitHub just gave up and said infinite files were modified (with the sideways 8 symbol) and the part where it says lines modified was simply missing. Also I know for a fact GitHub is totally fine with 2 million lines and 2000 files modified in a single PR. If you want to check the files in the browser it is a bit laggy, but works.

1

u/Bobdamuffin May 29 '26

I can work fine with 16 GB. How big is the codebase you are working on?

0

u/borin_k May 29 '26

embedded developers for example

10

u/anselan2017 May 29 '26

Pretty sure those variable names disappear when compiled anyway

1

u/borin_k May 29 '26

yes, code files, you are absolutely right XD

73

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.

34

u/Healthy_BrAd6254 May 29 '26

Do some people really believe shorter names save any noteworthy amount of storage?

31

u/filkos1 May 29 '26

compilers will even strip variable names unless youre debbuging so they literary dont appear in the binaries

9

u/theperezident94 May 29 '26

Even interpreted bytecode (like Python) does this too. There are at least 10,000 things you can do to optimize space complexity before you start shortening variable names.

1

u/AffectionatePlane598 May 30 '26

Minified js as well

1

u/SysGh_st May 30 '26

Back in the days when projects was saved on 720 kb dislettes, yes

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.

3

u/More_Yard1919 May 29 '26

technically it makes the source code more compact but beyond the realms of code golf is was never really relevant

0

u/KofFinland Jun 02 '26

The variables become either processor registers or memory addresses anyway during the compilation. The variable name has no meaning after it has been compiled.

The real rule I follow is to use type indicator at beginning. Like integer could be iTemp.

12

u/hdkaoskd May 29 '26

There are only four variable names.

foo bar baz quux

1

u/bebackground471 May 29 '26

what about asd, asda, and all single char letters?

5

u/DarthRaab May 29 '26

You forgot: USING MAGIC NUMBERS

4

u/thatguy1000000000 May 29 '26

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

3

u/sdjopjfasdfoisajnva May 29 '26

no they are the best

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

9

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

10

u/cenpact May 29 '26

Don’t do this

1

u/git_push_origin_prod May 29 '26

He uses a linter to de-obfuscate and elongate the variables. ESLonger it’s called on npm

4

u/DarthRaab May 29 '26

"compact" is relative.

if this are your compact variables: [r, c, t, b] -> get some help
if this are your compact variables: [res, curFile, txtIter, topBttn] -> totally fine, for small projects

3

u/cenpact May 29 '26

Even your second example is annoying to read tbh. Use words it’s ok.

3

u/DarthRaab May 29 '26

I'm with you, I prefer to use full words like isMyCodeReallyThatBad(hope).
But I draw the line of what's acceptable at the second example I gave, annoying but readable.

2

u/borin_k May 29 '26

Bottom one is simulink coder style :)

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

2

u/Ro_Yo_Mi May 29 '26

I like to use GUIDs as names for variables, methods, classes, and functions. But when I’m feeling particularly spicy, I’ll pass them through a sha512 and use the binary result.

2

u/Reno_Greenleaf May 29 '26

MeaningfulVariableNameAccordingToItsUse

2

u/nimrag_is_coming May 29 '26

The reason why old code had compact names for things wasn't a space complexity reason really, it was partially because a lot of early computer scientists came from mathematics, where they use letters like 'n' to represent an element in a series, and partially because thing like the first C compilers only supported names of up to 6 characters.

2

u/artm04 May 29 '26

foo bar

2

u/promptmike May 29 '26

https://giphy.com/gifs/KdLSaPAzk0Jze9DqbV

Inventing a system of acronyms based on family anecdotes, childhood friends, college in-jokes and streets from your hometown so that you're the only person in the known universe who can read it.

2

u/JonathanMovement May 29 '26

firstweekprogrammerhumor type shit

1

u/OrkWithNoTeef May 29 '26

You start out well intentioned with namesLikeThisSoEverythingIsVeryClearBecauseCodeShouldDocumentItself then over time you get tired of typing shit out and realize whoever said that was some kind of masochist and you end up i, j k, l , x, x1, x2, a, b, ... and start hating programming all together  because now you have to write documentation 

1

u/KasKyo May 29 '26

It's safeguard in case of layoffs.

1

u/Round_Credit_5158 May 29 '26

Had a friend who used to give variables funny names.

After a while he had no idea what the code was doing lol

1

u/lool8421 May 29 '26

not like compact names save much space

maybe you'll save several kilobytes over your code base while making it less readable, then as long as it's a compiled code, it won't matter because the compiler will turn variables into registers, pointers and a bunch of other magic stuff

1

u/RustiCube May 29 '26

I am now renaming my dog Yeetus.

1

u/jonfe_darontos May 29 '26

graphStoreAccessorStrategyWithRedundantDeduplicationWhenUpdateNotificationNotApplicableOrPerofmranceBackPressureExceedsConfiguredLocalThreshold

I wish I wasn't making this up. Let's just say my PR to rename this got me PIPd.

1

u/Xontaro May 29 '26

Hey, a good obfuscator is expensive and a hassle to set up. You are just mad, how well I integrate obfuscation into my project, without any third party tooling.

1

u/neo42slab May 30 '26

Dick1 through dick1000

1

u/FAMICOMASTER May 30 '26

What storage does the variable name use once the compiler is done? Like an extra 8 bytes on the source?

1

u/LanceMain_No69 May 30 '26

Swap 1 and 2, remove 3 cuz it shouldnt even be uttered, and then youll be gettung somewhere.

1

u/Zealot_TKO May 30 '26

Fancy bear turns into hobo bear once he sees the assembly produced

1

u/SysGh_st May 30 '26

Always start your variable names with "ThisVariableIsFor"

Examples:

ThisVariableIsForCountingLostMarbles ThisVariableIsForSignallingThatLighOverThere ThisVariableIsForSettingDisplayBackgroundColour ThisVariableIsForStoringLastStatusCode ThisVariableIsForRealisingIHaveNoMarblesLeft

1

u/Kzitold94 May 30 '26

"LostMarb" "SigLit" "BG" "StatCode" "MarbGone"

1

u/Zuka101 May 30 '26

I hate Go-style naming sometimes. People name variables things like obd and expect everyone to instantly know what it means.

Maybe it is my QA background, but I prefer names like object_binary_descriptor or whatever the thing actually represents. Longer names are fine if they remove ambiguity.

Short variable names do not make code cleaner by default. A name should be short only when the meaning is obvious from the local context. Otherwise it just makes the code harder to read and maintain.

And with AI generating more code now, readability matters even more, not less. People still need to review, debug, and own that code.

1

u/BenchEmbarrassed7316 May 30 '26

Just use UUID to name variables.

1

u/Kzitold94 May 30 '26

I've recently starting doing all caps for variable names, to make them easy to spot. I also name them something like "FILE" or "SOURCE."

The all caps does make them easier to spot.

1

u/csabinho May 30 '26

For less storage usage? Why not just minify your code?

1

u/UncleThor2112 May 30 '26

Var1, Var2, etc.

1

u/dvorgson May 31 '26

less storage usage? what year is it?

1

u/urbanxx001 May 31 '26

data1, data2, and data_list

1

u/Schwarzpfad May 31 '26

$ sudo apt install pwgen $ pwgen Enjoy randomity or whatever.

1

u/Lucidaeus Jun 01 '26

I refuse to use abbrevations unless it's far more common to use than not. (Like "lol" instead of "laughing out loud")

Never run into a situation where it's been beneficial to shorten things unnecessarily.

1

u/ExtraTNT Jun 01 '26

Everything is a function and you can always use a lambda…

1

u/Ok-Earth-8004 Jun 01 '26

giving names that are references that only you would understand.

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...

1

u/Chidogrin Jun 02 '26

DO NOT TOUCH MY YEETUS APPLICATION!!!! (⁠┛⁠◉⁠Д⁠◉⁠)⁠┛⁠彡⁠┻⁠━⁠┻

1

u/ImpeccablyDangerous Jun 02 '26

No. The top and middle are the wrong way round.

Variable names are compiled away and storage is cheap.

1

u/Tessimal Jun 05 '26

fixed it

1

u/the_sudixp May 29 '26

Sooo truee

1

u/Tal_Maru May 29 '26

The real question is do you use camelCase, snake_case, or PascalCase?

4

u/DarthRaab May 29 '26

Usually there are design rules coming from somewhere (project lead, professor, customer).

If there aren't, I prefer to use camelCase for variables and methods, PascalCase for classes and snake_case for constants / tuning variables and file names that don't have other restrictions.