default-parameters-pattern is an actively used design pattern. Syntactic sugar for setting values for parameters if not defined.

?Years Old

Languages with default-parameters-pattern include csharp, javascript

Example from csharp:

public void ExampleMethod(string optionalstr = "default string") {}

Example from javascript:

function multiply(a, b = 1) {
 return a * b;
}

Last updated June 22nd, 2020

Edit default-parameters-pattern on GitHub