News for hackers. Stuff that matters.
Re:It's probably time to stop recommending Clean Code (2020) by ajuc on Thursday May 27, 2021 @11:31AM (#27304283)
> local blocks that define which variables they read, mutate and export would IMO be a very good solution to this problem:

this is basically a lambda you call instantly.

    [&x, y, z] () {
        x = y + z;
    }();
Re:It's probably time to stop recommending Clean Code (2020) by MillenialMan on Friday May 28, 2021 @05:33AM (#27313333)
It's similar, but lambdas don't specify the behaviour as precisely, and they're not as readable since the use of a lambda implies a different intention, and the syntax that transforms them into a scope block is very subtle. They may also have performance overhead depending on the environment, which is (arguably) additional information the programmer has to consider on usage.