I knew a guy who would solely only use letters in the alphabet to name his variables. I'm not really sure how he kept track of his variables when he was doing class assignments.
I prefer a name long enough to be self-explanatory, but also not long enough to be redundant. Sometimes some of the purpose of the variable is explained in the context.
If you have a funcion named descendingSortArray(array), you don't really need to name the return as "descendingSortedArray" when "sortedArray" will do the trick.
114
u/1vader Feb 08 '21
Guess I'm not a weeb then since I always name my trash variables
x^^37
u/ExcelIsSuck Feb 08 '21
even if they aren't a weeb it ends up like that anyway
260
u/andybfmv96 Feb 08 '21
I just keep adding A's to my variables until my program gets louder and louder
53
u/[deleted] Feb 08 '21
acute ?
22
u/ash15157 Feb 08 '21
I knew a guy who would solely only use letters in the alphabet to name his variables. I'm not really sure how he kept track of his variables when he was doing class assignments.
19
u/SabreLunatic Feb 08 '21
gawrgura = “smol bean”
33
u/[deleted] Feb 08 '21
Please don't do this unless it's within a contained pure function with unit testing.
IMHO self-explanatory variables should always be the norm even if their names are long.
11
u/[deleted] Feb 08 '21
Waifu names
7
u/RJohn12 Feb 09 '21
I have a huge routine with a bunch of loops and i'm all the way to the letter H for random variables i need
3
u/Alberiman Feb 08 '21
agura?
3
u/Nefantas Feb 08 '21
I always call them ass.
3
u/DannoHung Feb 12 '21
foo bar baz bat quux
LEARN THE CLASSICS YOU HEATHENS
2
u/Ri_Konata Feb 08 '21
Tbh, I'm feeling attacked
2
u/banana_kiwi Mar 10 '21
Ah yes, the ever familiar
a_shark_chan1
u/SnickersZA Feb 09 '21
I still have trauma from a system I worked on years back that almost exclusively used single character variables. It was cancer..
1
u/HerrCrazi Feb 09 '21
I do name most of my throw-away variables 'a'...
1
u/Triande Jun 12 '21
I usually do one or two word jokes as variables,for example "mylife".
1
u/I_usuallymissthings Nov 08 '22
I really hate naming variables with long name, so almost all my functions return x