What Should I Be Using For If(Value.isNotBlank(), ..., _NoOp())

Hi @cnr ,
I second you: it’s not the best pattern ever and I use it a lot, too.

I didn’t find any better alternative, yet.
While not super-urgent, I’d like to see some shortcuts of else-less-if(s).
Something like DoIf() or DoUnless() (or naming variations like RunIf() etc…) that consider the default action is a _Noop().

Happy to know your idea on this, btw.
Cheers!

4 Likes