benc on Nostr: #[0] I got an interesting question I’d like to hear your take on. Is there any ...
unclebobmartin (npub19mu…jnft) I got an interesting question I’d like to hear your take on.
Is there any wisdom when comparing the pros and cons of returning a value versus passing an interface?
// two options for handling a value.
class Foo {
int returnValue();
void passInterface(Handler);
}
interface Handler {
void handle(int);
}
Is there any wisdom when comparing the pros and cons of returning a value versus passing an interface?
// two options for handling a value.
class Foo {
int returnValue();
void passInterface(Handler);
}
interface Handler {
void handle(int);
}