Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

How do I pronounce all this stuff

by erikharrison (Deacon)
on Apr 10, 2002 at 16:23 UTC ( #158060=perlmeditation: print w/ replies, xml ) Need Help??

Question: How do I pronounce $var? Or $_? I've gotten the impression that there is a way to read Perl aloud, but I don't know it . . . I figured it out while reading a discussion of the much debated "??" (hook hook) operator (though what ?? was supposed to do escapes me at the moment . . .).

It really come down to "what is the English translation of all this code I'm writing?".

Cheers,
Erik

Comment on How do I pronounce all this stuff
Select or Download Code
Re: How do I pronounce all this stuff
by BUU (Prior) on Apr 10, 2002 at 16:41 UTC
    Character Name . spot : two-spot , tail ; hybrid # mesh = half-mesh ' spark ` backspark ! wow ? what " rabbit-ears ". rabbit | spike % double-oh-seven - worm < angle > right angle ( wax ) wane [ U turn ] U turn back { embrace } bracelet * splat & ampersand[5] V V (or book) V- bookworm (or universal qu $ big money c| change ~ sqiggle _ flat worm overline + intersection / slat \ backslat @ whirlpool -' hookworm ^ shark (or simply shark #I[] blotch

      Puh-lease! Obviously, we're using the Universal Intercal ASCII Pronunciation Guide. But we could (at least) incorporate the common vernacular:

      &   ampersandHitchcock
      

      Shouldn't it be:
      ) wax ( wane
      i.e. shouldn't it follow the way the moon does it?
Re: How do I pronounce all this stuff
by Juerd (Abbot) on Apr 10, 2002 at 17:22 UTC

    How do I pronounce $var? Or $_? I

    I pronounce $ as "dollar", or as "string". The latter is because I used to code in BASIC, where a dollar sign suffix denotes a string variable - I try to avoid that habit, but sometimes I fall back. Sometimes I just say "variable" instead of "dollar" (just to avoid confusion, I don't say scalar).

    _ is "underscore", but sometimes I call $_ "default", instead of "dollar underscore".

    These may be (probably are) wrong, but this is what I'm used to:

    = is == equals eq equals (or "e q") ~ tilde $ dollar, variable ^ caret (but <tt>$^W</tt> --> "variable control W") @ at, array % hash _ underscore $_ default @_ default array {[( opening (or "left") curly, bracket, paren }[( closing (or "right") curly, bracket, paren : colon ; semicolon, stop / slash \ backslash, escape \n newline (not "escape n") \w word \s whitespace ` backtick <> glob, readline ("diamond" if without handle), tag (depending on co +ntext) < less-than-sign, opening (left) angle > greater-than-sign, closing (right)angle & ampersand, and && and (or "and and" to avoid confusion, "short and") | pipe, or || or (or "or or", "pipe pipe", "short or") ' single quote " double quote * asterisk, times -- decrease ++ increase # pound, comment, remark (not "hash" because of % :)
    I leave out parens and curlies where they're not optional. I often say "end of $control_structure" instead of "closing curly"
    So this:
    while (<>) { s/\r/blah/; print $_ || "Empty\n"; }
    becomes:
    while diamond, s slash carriage return slash blah slash, stop, print default, short or, double quote titlecase empty, newline, double quote, stop. end of while.

    Then again, my English is disastrous at best, so I don't think you should rely on this :)

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk
    

      "I leave out parens and curlies where they're not optional."

      Are you sure? (Sorry Juerd, I just couldn't resist. ;-)


      Everything went worng, just as foreseen.

        I think he meant it the way he said, as 'while (<>)' was pronounced as 'while diamond'? He knows the parens are needed, the Perl-knowledgable listener knows the parens are needed, so in a spoken context they're little more than line noise.

        Vocal line noise. Now there's a scary thought.

      #   pound, comment, remark (not "hash" because of % :)

      The # character should never be pronounced pound. I accept square sign, but means pound because it is simply a fancy L, which is short for the latin libra meaning pound. YAA (Yet Another Americanisation ;) ) that came about this time from the difference between UK and US keyboards.

      I have a wiry brain/each eye a camera. Robot Tourist, by Ten Benson

        The # character should never be pronounced pound.

        #perl (irc channel) is often refered to as "pound perl", and I tend to use "remark" when talking about code. When not in Perl context, I use "hash" for it, but that's far to confusing when talking about Perl code :).

        Yes, I reinvent wheels.
        

        # is obviously "sharp". That's how we get "sh-bang" (#!) to start every program!

        - Richie

        That's a pretty specious argument.

        In any event the name of # is of great debate. There are many terms (most listed in the two links I provided earlier (higher up, below.)

      • The Useless Pages used to have an entire section dedicated to this, I cannot find it now
      • Octothorpe
      • Despite the actual definition I had heard Sesquipedalian as a contender
      • Interesting observation
      • If - is a bithorpe and # is an octothorpe, why isn't * a hexathorpe? And if - is a bithorpe and = is a quadrathorpe, what's +? And furthermore, what's a thorpe?

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

Re: How do I pronounce all this stuff
by premchai21 (Curate) on Apr 10, 2002 at 17:41 UTC

    I assign many characters to small sounds, rather than whole words, myself. $ becomes 'zh', for instance (like the later part of 'j'). Example:

    (/\S/) && print $hash{$;.$_} for (@ary);

    is pronounced:

    in slash back-cap-ess slash out and-and print zh-hash de zh-semi dot zhunder for yary

      in slash back-cap-ess slash out and-and print zh-hash de zh-semi dot zhunder for yary

      this sounds almost like German!

      ze have veys of making you talk.

      metadoktor

      "The doktor is in."

Re: How do I pronounce all this stuff
by belg4mit (Prior) on Apr 10, 2002 at 17:43 UTC
    <>!*''# waka waka bang splat tick tick hash ^@`$$- carat at back-tick dollar dollar dash *!'$_ splat bang tick dollar underscore %*<>#4 percent splat waka waka number four &)../ ampersand right-paren dot dot slash {~|**SYSTEM HALTED curly bracket tilde pipe splat splat crash

    For the record I use

  • In my BASIC days chr$ was "chr bucks"
  • For perl I tend to stick to English punctuation names
    ('$'=>'dollar', '@'=>'array'||'ary', '%'=>'hash'||'percent', '#'=>'hash', '!'=>'bang', '#!'=>'shebang', '&'=>'ampersand', '*'=>'star', '/'=>'slash', '\\'=>'back-slash', "'"=>'tick', '`'=>'back-tick', '"'=>'quote"||'quot', #not usually pronounced '~'=>'tilde', #long E '?'=>'question mark, #hook is cooler but it never occurs to me '|'=>'pipe', '['=>'left bracket', #These rarely need ']'=>'right bracket',#to be pronounced '{'=>'left curly(?: brace)', '}'=>'right curly(?: brace)', '<'=>'less than'||'waka', '>'=>'greater than'||'waka', ... #dot dot dot, in this case however yadda yadda yadda );
    I read $_[1] as "array underscore sub 1" or worst case simply "at underscore 1".
  • --
    perl -pe "s/\b;([mnst])/'\1/mg"

      '\'

      '\\'
      And you missed a comma after 'greater than'.

      U28geW91IGNhbiBhbGwgcm90MTMgY
      W5kIHBhY2soKS4gQnV0IGRvIHlvdS
      ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
      geW91IHNlZSBpdD8gIC0tIEp1ZXJk
      

      belg4mit onomatopoetically offered:
      <>!*''# waka waka bang splat tick tick hash ^@`$$- carat at back-tick dollar dollar dash *!'$_ splat bang tick dollar underscore %*<>#4 percent splat waka waka number four &)../ ampersand right-paren dot dot slash {~|**SYSTEM HALTED curly bracket tilde pipe splat splat crash

      Is it just me, or does anyone else envision two kids sitting cross-legged across from one another, clapping their hands, knees, and each others hands as they chant this rhyming incantation? I think this is the basis for a whole new area of Perl poetry!

      Nice discussion. I do think I might be alone in using the american predilection for calling a dollar a 'buck' in my pronunciations while muttering perl code to myself:

      • $var: "buck var"
      • $_: "buck bar"
      • etc...

      Matt

      Update: Okay, belg4mit did make a 'bucks' reference. I'm not alone after all! Except perhaps with my reading retention skills. ;-)

        These are fairly standard in copy-editing:
        $  : "buck"
        _  : "score"
        |  : "bar"
        ?  : "hook"
        &  : "et" (it is a ligature of E and t)
        
        Think of all the extra milliseconds you'd have in your life if you always said "buck score" instead of "dollar underscore"! -- well microseconds, anyway.

        On the other hand, I call '#' "scratch", but I don't think anyone else does. Have no idea where I picked it up.

          p

Re: How do I pronounce all this stuff
by erikharrison (Deacon) on Apr 10, 2002 at 19:48 UTC

    Seems that several of us fall in to the "$var" being pronounces "string var" back from BASIC. BASIC is the only other language that I know (and that was years ago). I still have a bad habit of writing it "var$" instead of "$var". Actually, I don't have this problem - I've succesfully turned it into a problem writing BASIC vars.

    Oh, well

    Cheers,
    Erik
(crazyinsomniac) Re: How do I pronounce all this stuff
by crazyinsomniac (Prior) on Apr 11, 2002 at 00:00 UTC
Re: How do I pronounce all this stuff
by belden (Friar) on Apr 11, 2002 at 01:10 UTC
    I was trying to talk Perl over the phone one day and mispronounced $_ as "dunderscore" instead of "dollar underscore". Dunderscore has stuck with me ever since; I like the dunderheadedness of it.

    With Perl6 we'll be able to finally sing the old favorite:
    #! #! ... ... #! #! ... ... !

    blyman
    setenv EXINIT 'set noai ts=2'

Re: How do I pronounce all this stuff
by theorbtwo (Prior) on Apr 11, 2002 at 01:25 UTC

    Strange, nobody else so far has mentioned how larry told us to do it.

    The one time I tried to write perl poetry, I tried to have metre, and relized that I can't count sylables on somthing that looks like linenoize.


    We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book

Re: How do I pronounce all this stuff
by George_Sherston (Vicar) on Apr 11, 2002 at 09:19 UTC
    I say "dollar-var", when I'm singing my code to the tune of "Anything Goes".

    I usually translate { as a glottal stop followed by a change in pitch until the closing }. But don't try this at home.

    George Sherston

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://158060]
Approved by mdillon
Front-paged by ignatz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-09-20 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls