in reply to Re: What's the point of this 'overload' idiom?
in thread What's the point of this 'overload' idiom?

Overloading as a general concept is something you want very rarely, but is very useful when you do want it.

I really like that statement. Well put.

One area where overloading is highly desired is during unit testing. Although I'd classify it as 'overwriting' rather than overloading, the premise is the same. Make a function do something different than what the original does. For example, Mock::Sub does exactly this. Overriding functions during testing happens very often and is hugely useful.

  • Comment on Re^2: What's the point of this 'overload' idiom?

Replies are listed 'Best First'.
Re^3: What's the point of this 'overload' idiom?
by LanX (Saint) on Dec 07, 2022 at 14:25 UTC
    I might be wrong, but I think the technical terms for overwriting functions are I'd use overloading explicitly for perlops

    But this might be restricted to Perl lingo and different in other languages (the line between operators, built-ins and functions is blurred and depends on context)

    And I have to admit that I'm anal about terminology, a "maladie professionnelle" of studying math...

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

Re^3: What's the point of this 'overload' idiom?
by eyepopslikeamosquito (Archbishop) on Dec 08, 2022 at 12:40 UTC