629
submitted 2 years ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 29 points 2 years ago

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.

[-] [email protected] 12 points 2 years ago

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.

[-] [email protected] 2 points 2 years ago

I do this too. I hate using just x, because it's so non-descriptive.

[-] [email protected] 1 points 2 years ago

Yes! I love using x (and xs) for functions over whatever the thing is (or things are).

this post was submitted on 09 Jul 2023
629 points (94.0% liked)

Programmer Humor

37640 readers
184 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS