3 ms·
I 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.
by taylodl 4y ago
I 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...