in reply to Re: Perl OOP Function Entrance
in thread Perl OOP Function Entrance

It's not nonsensical if the intention was to have a "with" mechanism like in JS. (I doubt that's what the OP wanted and upvoted your post)

I.e. calling methods like functions inside a block which defines the target object and avoids redundancy.

See also http://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Statements/with

NB many listed contras are JS / implementation specific.

AFAIK it's kind of a (pseudo) DSL technique in Ruby to call methods with syntactic sugar (though I'm ignorant about the implementation there)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re^2: Perl OOP Function Entrance (with)

Replies are listed 'Best First'.
Re^3: Perl OOP Function Entrance (with)
by AnomalousMonk (Archbishop) on Aug 29, 2017 at 03:07 UTC
    It's not nonsensical if the intention was ...

    I suspect that some or all of the rationales you suggest may be in play. Impossible to know, of course, unless Mano_Man is more forthcoming. However, the justification given in the OP ("Simply because it is a requirement by the team.") suggests that "logic" of the "We're doing it this way because this is the way we're doing it" school may be at work, which makes the rat-poison line of argument all the more attractive.


    Give a man a fish:  <%-{-{-{-<