re: Language Features: Best and Worst VIEW POST

FULL DISCUSSION
 

1) A native not operator that can be prepended to any bool expression.

if not contains() { ... }

Simple ! is so unmarkable and not noticable when reading. But using false == ...() is ugly

2) defer like in golang. And option to defer a loop, not only a function. So action to be executed right after break (not just return)

3) a crazy idea but I'm always thinking about having a break-from-if operator. When you have compex if-logic, this option allows to make it easy, more flattened and therefore more readable

 

Literally today I tried to break from an if in Java and got a compiler error. It would be a super useful addition.

code of conduct - report abuse