Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Perl mnemonics

by zentara (Archbishop)
on Oct 07, 2008 at 16:01 UTC ( #715814=note: print w/replies, xml ) Need Help??

in reply to Perl mnemonics

Like dragonchild, I go with the mental picture is worth a thousand words. I never was good at remembering poems, limericks, or jokes; but I can pull an image out of my memory easily. Also, If you are not actually cramming for a closed book test, why not just take a quick look at some code snippets (either in your personal snippet lib or search

However, there was one recently that I do use, regarding the packing rules in Gtk2, which I just can't seem to get straight without looking at previous examples.

$vbox->pack_start ($widget, $expand, $fill, $padding);
it's the expand, fill, padding order that always gets me. So I remember

"extra fries please";

I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^2: Perl mnemonics
by TGI (Parson) on Oct 07, 2008 at 22:42 UTC

    If I did Gtk2 programming, I'd probably call that order "WE FliP".

    The pain of having to remember these orders is why any code I write that requires more than three arguments, gets modified to use named parameters. The downside is that you have to remember (and spell correctly) the parameter names, but that's what perldoc's for.

    TGI says moo

        When I write the code I may have to look everything up in either case.

        When I read the code, I understand named parameters without needing the docs.

        I consider that a big improvement. YMMV. Each approach can bring its own subtle bugs.

        TGI says moo

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2022-01-21 08:00 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (57 votes). Check out past polls.