One exclamation mark instead of two


#1

Hello, do you plan to reduce number of exclamation marks from two to one somewhere in future?
results!.size looks better than results!!.size


#2

Irrespective of the merits of one versus two ! symbols, that ship has sailed over a year ago (with the release of 1.0). I agree that results!.size looks better, and that is precisely the reason why results!!.size is better. The use of !! is ugly code, so it should look ugly.


#3

yes, i doubt there is no way to implement results!.size along with results!!.size


#4

I use checkNotNull or requireNotNull :slight_smile:


#5

instead of !! ?


#6

Yes, I prefer IllegalStateException and IllegalArgumentException to NullPointerException.

Obviously I try to avoid each unuseful check.

Otherwise we should require to write result!write


#7

No, we have no such plans. It’s very intentional that !! looks the way it does.


#8

Correct me if I’m wrong, but I believe they went the double route because it’s something you should only do if you’re 100% sure of it. It’s also easier to debug if you have two instead of one.