Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Perl mnemonics

by TGI (Parson)
on Oct 07, 2008 at 18:52 UTC ( #715831=note: print w/replies, xml ) Need Help??

in reply to Perl mnemonics

It isn't strictly perl, but it comes up doing graphics programming. When I need to remember the coordinate order for a box, I use "terrible" and "later babe" to remember whether the elements go in "top, right, bottom, left" or "left, top, right, bottom" order.

For example, CSS is terrible when you specify borders and margins:

margin: 1em 2em 3em 4em; // is equivalent to: margin-top: 1em; margin-right: 2em; margin-bottom: 3em; margin-left: 4em;

TGI says moo

Replies are listed 'Best First'.
Re^2: Perl mnemonics
by missingthepoint (Friar) on Oct 08, 2008 at 03:27 UTC

    Nice. In Cascading Style Sheets: The Definitive Guide, Eric Meyer uses 'TRouBLe' for that.

    The same book also has 'LoVe, HA!' for the source order of common pseudo-classes (link, visited, hover, active).

    email: perl -e 'print reverse map { chr( ord($_)-1 ) } split //, "\x0bufo/hojsfufqAofc";'
Re^2: Perl mnemonics
by eighty-one (Curate) on Oct 09, 2008 at 14:03 UTC
    I have to think of a clock to remember which order CSS properties go in.

    The day starts at midnight, when the minute hand points up, or towards the top of the object. As the day progresses, the hand moves clockwise around, and points towards the right, then the bottom, then the left.

    I spent quite a long time flipping through my CSS book when I needed to do something until I thought of that - I don't really work with CSS often enough that I could just memorize the order and know it without some help.

      "Terrible" stuck for me because I was having a terrible time remembering the order. And it was the first meaningful mapping I came up with.

      I am in awe of your power of observation. I never noticed that the ordering went clockwise--a note in the docs somewhere to that effect would have saved me thousands of reference book pages flips and hundreds of google queries over the years.

      TGI says moo

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2021-11-27 14:33 GMT
Find Nodes?
    Voting Booth?

    No recent polls found