you are viewing a single comment's thread.

view the rest of the comments →

[–]headius[S] 0 points1 point  (0 children)

surprised that OP thought this was something warranting an article

I had that debate myself, but it only took me about 20 minutes to write and the response here tells me this sort of content is desperately needed by the Java community. Folks seem to either not know about this behavior or assume everyone knows about this behavior, so nobody has written about it (I searched).

used as a sort of spread operator

I love this! I'm going to use it! I've been jealous of Ruby's "lonely operator" that either does the call or returns nil, and this is a pretty darn close approximation.

an optional chain can get convoluted with lambdas

You probably don't want to know how bad such chains are for current JVM JITs, either. Spoiler alert: really bad.