incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rui Silva" <>
Subject re: AS3 Enhancements: method overloading. Why do people want this?
Date Mon, 16 Jan 2012 15:18:26 GMT
> From: "David Arno" <>
> To quote Bertrand Meyer
> (
> "Overloading, the most masochistic device ever introduced, means that 
> can give the same name to several methods as long as they differ by at 
> one argument type. This is a rare example of a facility that has no 
> advantage, and many documented problems (it's confusing, and conflicts 
> object-oriented mechanisms such as polymorphism and redefinition)."
> I'm in full agreement with the above quote. I think it is good that AS3
> doesn't allow method overloading. Yet it is a popular request, so 
> other folk disagree with this. I'm therefore curious to know why people 
> requesting what ought - IMO - to be viewed as a bad thing.
> David. 

David, I completely agree with you (and Bertrand Meyer). I seem to remember 
that a lot of writers on the subject of clean/efficient code say that 
overloading is basically an overly abused construct (a bit like the 
Singleton pattern) and that most cases where it is used, it should be 
replaced by different methods whose names are pretty clear on what they 
differ. Even with constructors, which is something most overloading 
advocates refer to, could be replaced by static factory methods with a 
clear naming strategy (createWithDistance, createWithDistanceAndSpeed, 

I've been able to live without overloading in AS for ages and even if that 
was possible I doubt I'd ever use it or allow it to be used in my team. 
But, as David and Jeffry said, I wouldn't stand in the way of anyone 
wanting to implement something around that. Maybe someone can come up with 
a clever system that eases the task of the developer while keeping the code 
expressiveness to the final user. 


View raw message