▲ 319 ▼ @linux @programmerhumor !programmerhumor@lemmy.ml (files.mastodon.social) submitted 2 years ago* by ashishlotake@mastodon.social to c/linux@lemmy.ml 27 comments fedilink hide all child comments @linux @programmerhumor !programmerhumor@lemmy.ml
[–] eager_eagle@lemmy.world 24 points 2 years ago* (3 children) Unless they're indices, do yourself a favor and use meaningful names instead. I avoid index iterations the most I can tbh. And for nested loops,i and k is more readable. permalink fedilink source hideshow 6 child comments replies: [–] fidodo@lemm.ee 11 points 2 years ago Even for indexes I do index or something more specific for what it's indexing. Any simple iteration I just do map or each so the only time I ever need to actually index things is for more complex scenarios in which case it's worth it to have better names. Also with modem IDEs, auto complete is really good so you don't need to write a full variable name more than once. permalink fedilink source parent [–] reverendsteveii@lemm.ee 5 points 2 years ago When I was a baby coder back in the 90s we were taught that these names were meant to save space in the symbol table because at one time space was so limited that naming your variable n rather than numElementsInArray would have an impact permalink fedilink source parent [–] tkarika@lemmy.world 4 points 2 years ago This is the way. permalink fedilink source parent
[–] fidodo@lemm.ee 11 points 2 years ago Even for indexes I do index or something more specific for what it's indexing. Any simple iteration I just do map or each so the only time I ever need to actually index things is for more complex scenarios in which case it's worth it to have better names. Also with modem IDEs, auto complete is really good so you don't need to write a full variable name more than once. permalink fedilink source parent
[–] reverendsteveii@lemm.ee 5 points 2 years ago When I was a baby coder back in the 90s we were taught that these names were meant to save space in the symbol table because at one time space was so limited that naming your variable n rather than numElementsInArray would have an impact permalink fedilink source parent