here's a #java style question.
// completed with null if not found
CompletableFuture findObject();
// completed exceptionally if not found
CompletableFuture findObject();
// empty Optional if not found
CompletableFuture<Optional> findObject();
they'd all work so this is about style. which would be preferred?
the middle one is odd-one-out as it semantically says it's an error if the object can't be found rather than that being allowable.
=> More informations about this toot | View the thread | More toots from StrangeNoises@mastodon.social
=> View java tag This content has been proxied by September (3851b).Proxy Information
text/gemini