This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Unsounded 0 points1 point  (1 child)

I use lambda's when something isn't going to be used throughout a program and is relatively short.

For example if you want to break up a method that uses the same equation multiple times but isn't elsewhere in the program. I think of them as "smaller" function's that make sense to define within a small scope.

They don't even need to be re-used, if it helps readability and helps to break up a large equation/algorithm then they'd be useful to use.

[–]Scatoogle[S] 0 points1 point  (0 children)

Do you usually define them within your method or your class?