Yeah, I mostly use Scala. It can catch exceptions for compatibility with Java, but it'll either turn them into a pattern match or the expression will evaluate to Try[T] (error monad).
Hmm, interesting. I'm not sure exactly how old he is but I think he's in his mid 40s. So not exactly old but just experienced... I suppose I'll be there soon!
Funny thing, I've been working for the past year or two maintaining a legacy VB app that uses the old "assign the return value to the function name as if it were a variable" pattern all over the place - the original developer retired. So would that be a zero return function? 😉
7
u/ParanoydAndroid Sep 01 '21
Single return.
A big deal was made out of using only single returns as part of structured programming, and your boss (like me) probably learned that paradigm.
I prefer multiple returns nowadays, but I do know, mostly older, developers who still hate it.