The method-overloading tag has no wiki summary.
0
votes
3answers
526 views
Is function overloading in general considered Evil? [closed]
Recently I found about two new programming languages(Vala and google's GO) which don't support method or function overloading and intend on not supporting them in the future ever! The creators of ...
6
votes
4answers
251 views
How to prevent duplicate data access methods that retrieve similar data?
In almost every project I work on with a team, the same problem seems to creep in. Someone writes UI code that needs data and writes a data access method:
AssetDto GetAssetById(int assetId)
A week ...
5
votes
2answers
2k views
Why PHP doesn't support function overloading?
I am wondering if one of the key features of a programming language is to have the ability to overload functions via arguments. I think it is essential in-context of the Object oriented programming.
...
6
votes
2answers
226 views
Overload or Optional Parameters
When I have a function that might, or might not receive a certain parameter, is it better to overload the function, or to add optional args?
If each one has it's ups and downs - when would I use ...
8
votes
3answers
323 views
does one method overload an other, or are both methods “overloaded”
If i create this method
public void foo()
And then i create an overloaded version like this
public void foo( string bar )
Do we say that the second functions overloads the first, or are both ...
11
votes
1answer
352 views
Why is there no facility to overload static properties in PHP?
Intro
PHP allows you to overload method calls and property accesses by declaring magic methods in classes. This enables code such as:
class Foo {
public function __get($name) { return 42; }
}
...
4
votes
3answers
601 views
When is method overloading appropriate?
Suppose I am working on an existing, reasonably large system. I have an object, myObject of class MyClass (for the example's sake, suppose I'm working in Java). myObject is a composition containing a ...
8
votes
3answers
364 views
Should we rename overloaded methods?
Assume an interface containing these methods :
Car find(long id);
List<Car> find(String model);
Is it better to rename them like this?
Car findById(long id);
List findByModel(String ...
3
votes
6answers
468 views
How to resolve methods with the same name and parameter types?
In many cases, I want to write methods that have the same functionality for different types of inputs. This is easily accomplished by method overloading if the parameter types are different.
But ...