Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Dots and cargo-cult programming

by Everlasting God (Beadle)
on Jul 14, 2001 at 21:42 UTC ( [id://96779]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Dots and cargo-cult programming
in thread Dots and cargo-cult programming

Not to be pedantic, but where I come from (c++) -> *is* the standard way to call functions that live inside an object that you have a pointer to, which is pretty much the only way I ever use it in perl too. (blessed ref to an object)

'The fickle fascination of and Everlasting God' - Billy Corgan, The Smashing Pumpkins
  • Comment on Re: Re: Dots and cargo-cult programming

Replies are listed 'Best First'.
Re (tilly) 3: Dots and cargo-cult programming
by tilly (Archbishop) on Jul 14, 2001 at 21:51 UTC
    Several of the differences between Perl5 and Perl6 are intended to reduce the amount of dereferencing you have to do. So I like thinking of this syntax change as just being Yet Another way of indicating to people that you are supposed to be thinking in terms of more immediate data structures and less about having a reference that you dereference.

    YMMV, but that is true to the usage of both . and -> in C.

      I'm not sure I follow this. The dot is ugly, but it's not like it inherently discourages you from using it. In fact, it could be said "->" is better for that purpose: more letters to type. (And 3 times more keys!) Plus, you have to use it for objects, unless you want to encourage 'indirect object' syntax.

      -- Frag.

        In C accessing a struct directly is done with a ".", but accessing a struct through a reference is done with an "->". So to my eyes the arrow says "indirected through a reference.

        YMMV.

Embrace change (was "Re: Re: Re: Dots and cargo-cult programming")
by rrwo (Friar) on Jul 16, 2001 at 21:37 UTC

    Well I'm glad somebody pointed this out.

    It isn't to emulate Java, VB or SmallTalk so much as to make the code cleaner and easier to parse. Admittedly I'm attached to the existing arrow operator but I can get used to using a dot instead.

    There are more important battles to fight. That's such a minor one.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://96779]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.