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 | More toots from StrangeNoises@mastodon.social
i would tend to return the Optional if it was direct and not in a Future. But in the context of returning a Future it feels excessively clunky maybe?
[#]java
=> More informations about this toot | More toots from StrangeNoises@mastodon.social
text/gemini
This content has been proxied by September (3851b).