I was just discussing a method with colleague, the usage looks a little like this:
String myString = getString(fields[10], true);
Now here's my question, what does true do?
The obvious answer is to look at the method definition and see what it does with that boolean, but why do I need to do that? Is there a better coding style that will explain the purpose of the boolean right there in the method call?
I thought initially to change the method to accept a specific string, but that's far too loose.
The best idea I can come up with is to create a local boolean, like this:
boolean thisShouldBeUpperCased = true;
String myString = getString(fields[10], thisShouldBeUpperCased);
Has anyone come across this before, is there a better way?