Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: What are the drawbacks of autobox?

by punkish (Priest)
on Feb 28, 2010 at 20:02 UTC ( [id://825779]=note: print w/replies, xml ) Need Help??


in reply to What are the drawbacks of autobox?

not adding anything of value to this discussion other than to say, thanks for bringing autobox to my attention. I had no idea this existed. And, contrary to what others may think, I do find the ability to "turn everything into objects" very useful. It is not a matter of "if I want to code like Ruby then I should use Ruby." It is more like giving Perl the ability to program in a currently popular, and arguably easier, idiom of programming.

Look forward to more dissection and discussion of autobox.

--

when small people start casting long shadows, it is time to go to bed

Replies are listed 'Best First'.
Re^2: What are the drawbacks of autobox?
by LanX (Saint) on Feb 28, 2010 at 21:49 UTC
    > not adding anything of value to this discussion

    Your plain wrong, you did! ;-)

    I was recently complaining about many Pythonistas having this fundamentalist "There is only one true way to code and Guido is the prophet" attitude.

    I was even claiming that the Perl crowd having more tolerance about paradigms, giving them the flexibility to adopt to new tasks...

    Well ...maybe I wasn't completely wrong ... thanks! 8)

    Cheers Rolf

      There's flexibility and there's following fads.

      Show me a valid, real-world use case in which there is a significant advantage to treating the number 3 as an object rather than as a simple integer and I'm happy to be flexible and consider whether I would find a benefit in doing things that way. Until then, the idea that everything must be an object and all action should be expressible as method calls looks an awful lot like a fad to me.

        Show me a valid, real-world use case...

        OK one more try:

        This is valid JS Code: ¹

        var fruits = ["Banana", "Orange", "Apple", "Mango"]; document.write(fruits.push("Kiwi") + "<br />"); document.write(fruits.push("Lemon","Pineapple") + "<br />"); document.write(fruits);

        this is still valid JS-Code

        var $fruits = ["Banana", "Orange", "Apple", "Mango"]; document.write($fruits.push("Kiwi") + "<br />"); document.write($fruits.push("Lemon","Pineapple") + "<br />"); document.write($fruits);

        with the help of autobox this could become valid perl code:

        my $fruits = ["Banana", "Orange", "Apple", "Mango"]; document->write($fruits->push("Kiwi") + "<br />"); document->write($fruits->push("Lemon","Pineapple") + "<br />"); document->write($fruits);

        or maybe better without overloading +

        my $fruits = ["Banana", "Orange", "Apple", "Mango"]; document->write($fruits->push("Kiwi") . "<br />"); document->write($fruits->push("Lemon","Pineapple") . "<br />"); document->write($fruits);

        Real world enough for you???

        Cheers Rolf

        ¹) from my first google hit on "javascript push" http://www.w3schools.com/jsref/jsref_push.asp

        UPDATE: corrected . to ->

        Show me a valid, real-world use case in which there is a significant advantage to treating the number 3 as an object rather than as a simple integer

        Your reducing the possibilities of autobox to a little feature.

        And did I ever say I want to call a method on 3?

        I'm really surprised by the emotions caused by this little question about the technical side-effects of a cpan module, I didn't expect the Spanish inquisition...

        Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://825779]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found