In general, Scala will try to guess (“infer”) the types of many things, including the return types of defs.

That includes Unit, so you can totally write def foo = println("Hello").

However, I personally prefer to write the return types of functions that may be used by other pieces of code explicitly. That way, somebody can have a better idea of what the code does by just looking at the signature.

Nothing says “I don’t care” like an underscore. I’m bummed that the underscore.io store is all out of the moody tee that is black except for a single white _. Also, Single White _ should be the next sequel to Single White Female, in which Bridget Fonda plays a software designer. If underscore provides seed money to produce it as a diversity recruiting tool, it would be called Single: _* or possibly _: Singleton.

That is called the ‘procedure syntax’ and it’s a deprecated syntax. It will be removed in Scala 3 (at latest) so it’s best not to have it in the codebase (will make things easier on yourself or whoever maintains the codebase after you).