Re: Function Overloading
In article <40a2e150$0$306 $7a628cd7@news. club-internet.fr>,
Guillaume wrote:[color=blue][color=green]
>> What risks do you see?[/color][/color]
[color=blue]
> 1. Code becomes quickly difficult to understand. Or worse: it
> makes you think you understand it, when you actually don't.
>
> 2. As any other kind of superfluous facility, it's an incentive
> to use and abuse it.
>
> 3. There can be some nasty "ambiguous overloading" bugs. I've
> seen it many times in C++ code. Not all compilers are able to
> catch them. It can especially happen with operator overloading.
>
> 4. It makes you "overload" functions that you think are
> functionnally similar. It may later on turn out that they are
> not so similar, but by the time you realize that, hundreds of
> other functions may depend on them. A hell to maintain.
>
> 5. It's usually some overhead at run-time (although this point
> may not qualify as a "risk"). And a huge overhead at compile
> time, which has its importance when you work on very big
> projects (might not want to wait for hours while your code
> compiles...)
>
> 6. Speaking of overhead, they often imply security issues
> through the use of "v-tables". I'm not getting into details
> here, but many papers have been written on the subject.[/color]
Based on that last point, I think we might have different things
in mind. The function overloading I thought you meant is static,
compile time polymorphism, like that used for C's operators.
--
Neil Cerutti
"The barbarian seated himself upon a stool at the wenches side, exposing
his body, naked save for a loin cloth brandishing a long steel broad
sword..." --The Eye of Argon
In article <40a2e150$0$306 $7a628cd7@news. club-internet.fr>,
Guillaume wrote:[color=blue][color=green]
>> What risks do you see?[/color][/color]
[color=blue]
> 1. Code becomes quickly difficult to understand. Or worse: it
> makes you think you understand it, when you actually don't.
>
> 2. As any other kind of superfluous facility, it's an incentive
> to use and abuse it.
>
> 3. There can be some nasty "ambiguous overloading" bugs. I've
> seen it many times in C++ code. Not all compilers are able to
> catch them. It can especially happen with operator overloading.
>
> 4. It makes you "overload" functions that you think are
> functionnally similar. It may later on turn out that they are
> not so similar, but by the time you realize that, hundreds of
> other functions may depend on them. A hell to maintain.
>
> 5. It's usually some overhead at run-time (although this point
> may not qualify as a "risk"). And a huge overhead at compile
> time, which has its importance when you work on very big
> projects (might not want to wait for hours while your code
> compiles...)
>
> 6. Speaking of overhead, they often imply security issues
> through the use of "v-tables". I'm not getting into details
> here, but many papers have been written on the subject.[/color]
Based on that last point, I think we might have different things
in mind. The function overloading I thought you meant is static,
compile time polymorphism, like that used for C's operators.
--
Neil Cerutti
"The barbarian seated himself upon a stool at the wenches side, exposing
his body, naked save for a loin cloth brandishing a long steel broad
sword..." --The Eye of Argon
Comment