Lambdas everywhere!
-
@topspin said in Lambdas everywhere!:
Although std::for_each is still way inferior to range-based for loops, so there basically was never any time that was usable.
True. The only use I've found for
std::for_each
is operating on a subset of a container delimited by iterators:std::for_each(it1, it2, do_the thing);
-
@topspin said in Lambdas everywhere!:
Now with lambdas you can finally actually use these things without going crazy.
… except the two iterators mean they are not composable and that basically still defeats the purpose. C++20 finally tries to fix that with ranges. Except I only got to C++17 so far due to need to support older compilers for older systems.
-
@jinpa said in Lambdas everywhere!:
@Kamil-Podlesak said in Lambdas everywhere!:
I know that I am not the first one, but this cannot be overstated: try JavaScript and you will see how wrong your perspective is.
This cannot be overstated: the existence of worse does not show that recognizing something as bad is a wrong perspective.
Perspective is always relative. In this case, however, it is not about "good" or "bad" - it's about the "new framework every six months"
-
@jinpa said in Lambdas everywhere!:
Sometimes I was working on legacy software that had been touched by different people every six months.
"Show me on the source code where the contractor touched you."
-
@Kamil-Podlesak said in Lambdas everywhere!:
it's about the "new framework every six months"
That's when things get horrible. Some of it is caused by time going by too damn fast, and some is caused by needing to combine several frameworks to achieve the thing you want to do (because they have their own update schedules), and some is caused by ADHD.
-
@dkf said in Lambdas everywhere!:
somemost is caused by ADHD
-
@dkf good old CADT development model.
-
@Bulb - Agreed. If one strives for maximum encapsulation and minimization of duplication, lambdas start to become more pervasive. Have three pieces of code that need to be in try {} catch {} with identical catch structure and handling... implement the functional body of the try as a lambda, then a list, then loop across a single implementation of the try catch.
-
@dkf said in Lambdas everywhere!:
@jinpa said in Lambdas everywhere!:
Sometimes I was working on legacy software that had been touched by different people every six months.
"Show me on the source code where the contractor touched you."
Try a code base going back over 30 years, sometimes over 400 developers at a single point in time...
-
@jinpa said in Lambdas everywhere!:
@boomzilla said in Lambdas everywhere!:
Were you working on new projects every six months?
Sometimes. Sometimes I was working on legacy software that had been touched by different people every six months.
Take comfort; we are probably mortal.
-
@Gribnit speak for yourself.
-