If you rename a method, it is no longer going to be overloaded. In and of itself, overloading doesn't necessarily make code less readable, however it can make the implementation more difficult to follow if the syntax isn't clear.
Many languages use method overloading as a means to present an interface to functionality where the parameters may be optional and defaults for the optional parameters are implied. This is particularly true for languages that do not support a default parameter syntax in the method declaration.
So doing this:
void MyMethod(int param1, int param2 = 10)
{
...
}
saves you from doing this:
void MyMethod(int param1)
{
MyMethod(param1, Param2Default);
}
void MyMethod(int param1, int param2)
{
....
}
As to which is more readable, that really comes down to you. Personally I prefer the second option, particularly when the parameter list is getting a little long, but I suppose it doesn't really matter so long as you are consistent throughout your API.
The difficulty with overloading comes when you want functions that do essentially the same thing, and where you want the parameter lists to be the same, but the return types to be different. Most languages don't know how to differentiate between two methods named the same, but with different return types. At this point, you need to think about either using generics, changing the parameter interface, or renaming one of your methods to indicate the difference in return type. This is where readability can become a big issue, if you don't settle on a simple and clear naming scheme to deal with situations like this.
Naming your overloaded methods GetSomething()
and GetSomethingEx()
isn't going to say a lot about what the differences are between your methods, particularly if it is the return types that are the only differences between them. On the other hand, GetSomethingAsInt()
and GetSomethingAsString()
tell you a little more about what the methods are doing, and while not strictly an overload, do indicate that the two methods do similar things, yet return different value types. I know that there are other ways you could name methods, however for the purposes of illustrating the point, these crude examples should do.
In the OPs example, the rename isn't strictly necessary because the method parameters are different, however it does make things a little clearer to name a method more specifically. In the end, it really comes down to the type of interface you wish to present to your users. A decision on whether on not to overload should not be made solely based on your own perception of readability. Overloading methods can for example simplify an API interface and reduce the number of methods that a developer might need to remember, on the other hand, it can obfuscate the interface to a degree which then requires a developer to read the method documentation to understand which form of method to use, whereas having a number of similarly yet descriptively named methods can make it more apparent just be reading a method name as to its purpose.