Groovy default params to avoid one-argument methods being called without params
Recently, I saw an interesting tweet, mentioning a JavaScript trick using default parameters to make a parameter mandatory.
In a language like Apache Groovy, when statically compiled, you’d get a compilation error if you forgot a parameter, because the signature couldn’t be found by the compiler. In dynamic mode, you’d get a runtime error though, with a MissingMethodException (and the error message should give you a hint as to which method you should actually call instead).
Read more...

