mastermind@lemm.ee to Programmer Humor@lemmy.ml · 2 years agowhy not a,b or x,y?lemm.eeimagemessage-square97fedilinkarrow-up1646arrow-down142
arrow-up1604arrow-down1imagewhy not a,b or x,y?lemm.eemastermind@lemm.ee to Programmer Humor@lemmy.ml · 2 years agomessage-square97fedilink
minus-squaredark_stang@beehaw.orglinkfedilinkarrow-up29·2 years agox is used for map, filter, etc. a and b are used for sorts, comparisons and merges. y might be used if I’m doing multiple lambda expressions (but that means I’m in a bad place already). I have no idea why, but these are firm rules in my brain.
minus-squareDogMuffins@discuss.tchncs.delinkfedilinkarrow-up12·2 years agoI’ve gotten used to using the singular form as in… records.filter((record) => …) Not saying this way is better but it works for me.
minus-squarekarbonkel@beehaw.orglinkfedilinkarrow-up2·2 years agoI do this too. I hate using just x, because it’s so non-descriptive.
minus-squareruss@programming.devlinkfedilinkarrow-up1·2 years agoYes! I love using x (and xs) for functions over whatever the thing is (or things are).
x is used for map, filter, etc. a and b are used for sorts, comparisons and merges. y might be used if I’m doing multiple lambda expressions (but that means I’m in a bad place already). I have no idea why, but these are firm rules in my brain.
I’ve gotten used to using the singular form as in…
records.filter((record) => …)
Not saying this way is better but it works for me.
I do this too. I hate using just
x
, because it’s so non-descriptive.Yes! I love using x (and xs) for functions over whatever the thing is (or things are).