5 ms·
As a kid? When writing stupid scripts, I frequently use `fart` as a variable name to this day. I'm a staunch supporter of naming variables intentionally in sof
by belthesar 4y ago
As a kid? When writing stupid scripts, I frequently use `fart` as a variable name to this day.
I'm a staunch supporter of naming variables intentionally in software that lives, but I'm definitely not above doing a `fart=True; while fart: ...` in temporary repl work.
Maybe I'm just eternally 10 years old, haha.
- rootusrootus 4y agoHeck, when I write throwaway scripts most of my variables are different slang terms for feces. Sure, I use foo, bar, baz, bing sometimes too. But I never grew up either. At some point I decided that was a Good Thing, and I have no further plans to mature.
- taylodl 4y agoI must be old-fashioned! My variable names in throwaway programs tend to be x, y, and z and my iteration variables tend to be i, j, and k.
- deleted 4y ago[deleted]
- noboostforyou 4y agoSame (did you start learning programming with C?). i++ is pretty much hardcoded into my brain.
- craigkilgo 4y agoEveryone doesn't use i,j,k for counting variables?
- tqwhite 4y agoYes. At least all decent people.
- jasonhansel 4y agoHuh. I tend to use the first letter of the type, so "s" for a string, "d" for a dictionary, etc. Then "s2," "d2," etc. if there are more than one.
- SoftTalker 4y agoWhen I learned programming the BASIC variant I used only supported two-character variable names. And even where longer names were allowed, the text of the program consumed memory so you could optimize by keeping variable names as short as possible. So I had the habit of using single-letter variables for quite a while. I still use them as loop counters, or in small functions where the scope of the variable is maybe a few lines of code and completely unambiguous. In such cases I think long variable names are distracting.
- qolop 4y agoMy foo is "yo" and my bar is "ho"
- volkanvardar 4y agoMine are: x, xx, xxx, xxxx...
- laylomo2 4y agoMine are just whatever happens to be under the keyboard layout I'm using at the time. If qwerty, then `asdf`, `qwer`, `uiop`, `zxcv` are likely to be temp variable names. But since I've dabbled in other layouts, I've found the names have changed to: - Dvorak: aoeu, htns, gcrl, mwvz - Colemak: arst, neio, qwfp - Mtgap: inea, htsr, dlcw, fvgj etc...
- andai 4y agoIn college, usually a few minutes before an assignment was due, I'd frantically Ctrl+F the project for various curse words.
- olav 4y agoNice. I vividly remember the days, sometimes in the 80s, in some university cellar, hacking away at our green-lit vt terminals connected to some vaxens, that one of the other regulars in the room and I used temp variables _hudli_ and _tralla_ as some kind of ritual.
- olav 4y agoAh, "hudli hudli" stands for "Extraordinarily fast guitar playing" https://www.urbandictionary.com/define.php?term=Hudli https://www.urbandictionary.com/define.php?term=Hudli - it's only now that I look this up
- dark-star 4y agoheck, in MY time, variables could only have 2 (significant) letters, so we were stuck with "hi", "jk", "ah" and things like our initials.... The good thing is that since only 2 letters were significant, the variables "fa", "fart", "fan", "fall" etc. were all treated the same, which could cause some confusion to people not familiar with the intricacies of C64 BASIC ;-)
- ExtremisAndy 4y agoAre you serious?! That is so hilarious to me, because I do the same thing! And I am always so terrified that I will get an interview, and they will want to see a sample of my code, and I will have forgotten to take out all the bits of juvenile humor that are scattered through the code of my personal projects!
- xyzelement 4y agoI actually try to not do that now. As they say, programming is the art of naming and I think forcing myself to think about what a variable is (and then using that name) leads to better outcomes. Agree for throwaway work it may not matter but I try to keep myself disciplined anyway. A good example is say I am doing an advent of code and the temptation is to treat it as throw away code. But the reality is, sometimes I put it down and come back to it, and having variables like fart doesn't really help snap back into the context. Not saying this is an absolute but I find it a general rule of thumb for myself