Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

quest for perl mnemonics

by neophyte (Curate)
on Mar 19, 2001 at 20:47 UTC ( #65452=perlmeditation: print w/replies, xml ) Need Help??

This is a private quest for all kinds of mnemonics to do with perl.
There can be rhymes, comparisons, you name it ...
If you have ever used any kind of mnemonic to remember a function, a switch or even snippets this is the place to jot them down.

Unfortunately I made most of my mnemonics in German (where they are called "Eselsbrücke" - donkeys bridge), so I can only give a few:

  • -t spells minus trouble
  • strict is like a policeman - protects everybodys property (gaining property in Perl is simple, just say its yours)
Both were made for a beginner, to make him remember to use -t and use strict; in his code.

neophyte Niederrhein.pm

update: By private I mean that it is no official quest where the best answer is awarded anything more than xp. It is of course not only for me, but for all ohter users of the site. And it might give additional ideas to those of us that are learning or teaching perl.
I said all kine of mnemonics, and I meant it.
Sorry for being not as clear as could be.

Replies are listed 'Best First'.
Re: quest for perl mnemonics
by footpad (Abbot) on Mar 19, 2001 at 21:46 UTC

    Two quick thoughts:

    • perlvar lists a variety of interesting mnemonics.
    • I use "CTF" to remember the syntax of the conditional operator. It stands for either "Condition? True : False" or "Capture the Flag" (useful if you play FPS games). Your choice.

    --f

Re: quest for perl mnemonics
by arhuman (Vicar) on Mar 19, 2001 at 20:59 UTC

    Unfortunatly the best mnemonics are the one which are personnal.

    I managed to remember some mnemonics given in the Camel book
    (those about the perlvar...)
    But they're not as efficient with me as the one I made myself..

    So my question is : will my (french!) mnemonics be useful to you ?

    Netherless Perl and a lot of other good tools use option name and shortcut
    based on english words (the -T for Tainted mode...) I've learn to use it to
    recall them more easily.
    (when It was obvious or when I couldn't find a good mnemonic by myself)

    UPDATE :
    Another related advice I would give you is to first determine what kind
    of memory you have (visual, auditive...) to define the best way to boost
    your memory .

    For my part having a visual memory I only recall what I read, so I spot the page whith the info I want to remember and then I read it several time
    (I then 'see' the page each time I'm looking for one info...)
    but some people need to recite/hear some sentences to recall the info...

    This is important too in the way you choose your mnemonics if you have
    an auditive memory rhymes is a good way,
    (-Tainted is the mode which protects your code)
    if you have a visual memory you could build picture to remind the info
    (like imagining a T like an umbrella with hackers bouncing on it, could be a good mnemonic for the -T switch...)

    Of course you're encouraged to find better example ;-)

    "Trying to be a SMART lamer" (thanx to Merlyn ;-)
      Unfortunatly the best mnemonics are the one which are personnal.

      This is true, thats why most of mine are in German (it is my first language after all). But I'm sure we can try to translate/explain french examples, as I did with the strict-policeman comparison. :)

      neophyte Niederrhein.pm

Re: quest for perl mnemonics
by belg4mit (Prior) on Jan 25, 2002 at 05:54 UTC
    I came up with this in the CB a bit ago, and I shall now never forget. For sorting
    cmp is letters for letters

    Corollary

    spaceship is math (<, =, >) for numbers)

    --
    perl -pe "s/\b;([st])/'\1/mg"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-08-11 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?