As far as I'm concerned, if your function is called
isTransposed, then checking the values of
11/11 should yield
The definition of transpose is:
Cause (two or more things) to change places with each other.
...it doesn't have anything to do with input and output being identical.
Think of it as:
* Check whether date2 is the same as date1 with the month and day
boolean isTransposed(Date date1, Date date2);
* Determine whether or not the month and day of date1 have been
* transposed in date2.
boolean hasBeenTransposed(Date date1, Date date2);
Then it could fail, because it would not have a reasonable way to figure out whether or not they really were successfully transposed.
After receiving numerous comments about how "I can only guess what the expected result would be", let me clear it all up once and for all.
The question is:
When checking for transposed day and month values between two Dates - should comparing 11/11/2000 and 11/11/2000 return true or false?
And the function is:
Now, this function contains two words: is and transposed. We all know what is refers to: to be. Not may be: to be. You can find the definition for tranposed above.
There is no context whatsoever, and none of these two words are up to interpretation: they each have their own clear definition.
The question is not "Is this function name appropriate?" or "What should this function check for?". If one thinks otherwise, then he is the one guessing.