Re:Python's “Disappointing” Superpowers
by sitharus on Wednesday February 01, 2023 @06:06PM
(#34619404)
And C# can do that with static typing via LINQ, which is really nice honestly. It’s a bit different but it would be something like:
var result = await (from c in Customer where c.orders.sum(o => o.price) > 1000 select c).ToListAsync();
This is cool if it works. Good luck when it doesn't due to user error, and more luck if it doesn't due to a bug.
You need to develop a whole strategy to tell the user what went wrong and how, and why, basically from scratch; admitting that you didn't, in fact, execute the generator, and that they have to change it. because of that.
It's pretty awesome that it's possible. And it would be pretty amazing to write something like that. But... idk if it's a good idea from a developer stand point. I like being able to understand what's happening in a library with a single click.