Sean Hoffman
1 min readJul 27, 2022

--

Lambdas still bring up the question of context discovery in production systems when you're looking at logs trying to diagnose what went wrong when it all went to Hades. "What function was I in when the crap hit the fan?" A couple of related things I've learned in my couple of decades of programming are:

1. Things will blow up in production that will you have to diagnose. This will not happen at optimal times.

2. They will blow up in code that you've written (and in nooks and crannies have possibly forgotten)

3. They will blow up in code that you haven't written, but are still forced to diagnose.

The more context you have in the logs, the better.

Now perhaps it's not an issue if you have line-numbers; Go will print out a stack trace with line numbers in a panic, C++ most certainly will not (well not by default anyway). I have no idea about Rust; I assume they do as well. I happen to like Lambdas in general, but the case to use them must be considered in the context of other things besides the immediate convenience of not having to break code out into its own function.

--

--

Sean Hoffman
Sean Hoffman

Written by Sean Hoffman

Software Developer (C++, C#, Go, others), Husband, Father. I eat fried potatoes annually on July 14th.

Responses (2)