Re:An Overwhelmingly Negative and Demoralizing Force
by gopher_space on Tuesday April 08, 2025 @05:33PM
(#43626685)
My cleverest one-liners will block me when I come back to them unless I write a few paragraphs of explanation as well.
Re:An Overwhelmingly Negative and Demoralizing Force
by ethbr1 on Wednesday April 09, 2025 @12:41AM
(#43628919)
>> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan
Re:An Overwhelmingly Negative and Demoralizing Force
by johnnyanmac on Tuesday April 08, 2025 @09:13PM
(#43627996)
Ymmv. Know your language and how it treats such functions on the low level. It's probably fine for Javascript, it might be a disaster in C++ (indirectly).
Re:An Overwhelmingly Negative and Demoralizing Force
by banannaise on Tuesday April 08, 2025 @11:29PM
(#43628643)
> "lambda x : x if x else 1"
I think what you're looking for is "x or 1"
I should also note that development style also depends on tools, so if your IDE makes inline functions more readable in it's display, it's fine to use concisely defined lambdas.
Readablity is a personal preference thing at some point after all.