Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Perl mnemonics

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


in reply to Perl mnemonics

Like dragonchild, I go with the mental image.....one 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 groups.google.com).

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found