Hacker News new | ask | show | jobs
by nerdponx 2532 days ago
I for one predict that the new operator will appear very sparingly, in while loops and code golf competitions.

There are already so many complicated semantics about mutability, iteration, bytes/strings, scoping, et al. And yet somehow a tiny piece of syntax that finally lets us stop writing "while true/break" is the big pain point?

2 comments

I'd expect the new operator to become the idiomatic way to write certain quite common things, for example regexp group matching and objects returned by dictionary .get() - currently you always need a dummy variable to check if it's not None before you use it.
Excess complexity almost always comes in small increments...
Fair. Fortunately with all the blowback over the walrus operator I don't think we will be seeing any new operators for a long time.