1101
submitted 1 year ago by coja@lemmy.ml to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] Zangoose@lemmy.one 2 points 1 year ago

See the other comments about lambdas vs. lambda calculus, but lambdas are supposed to be for incredibly simple tasks that don't need a full function definition, things that could be done in a line or two, like simple comparisons or calling another function. This is most useful for abstractions like list filtering, mapping, folding/reducing, etc. where you usually don't need a very advanced function call.

I was always taught in classes that if your lambda needs more than just the return statement, it should probably be its own function.

this post was submitted on 19 Jul 2023
1101 points (98.4% liked)

Programmer Humor

31990 readers
95 users here now

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

Rules:

founded 5 years ago
MODERATORS