def execute(parameterName : scala.Boolean = { /* compiled code */ })
When calling this method, you can go with
someobject.execute(true)
or
someobject.execute(parameterName = true)
If you use the former, IntelliJ pops up a recommendation stating that Boolean arguments should be named. But doesn't this introduce an unnecessary dependency on the name of the parameter? Essentially the name of the parameter becomes part of the interface.
If I then change the name of parameterName
in execute()
to something else, I potentially break a lot of code that is using the execute method.
I understand that it improves readability a bit (you can look at the code and see which Boolean is being set to true without having to look at the called method). But is it enough of an advantage?