Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'm lazy when it comes to speaking code. I assume that my listener already knows Perl and so I can say what I want my code to achieve rather than worry about specific symbols. This is particularly true when I'm reading code to myself.

So, to take a simple example:

while (<>) { s/foo/bah/g; print $_ || "Nothing\n"; }
I'd say:
While diamond, substitute foo for bar; globally. Print it or the string Nothing with newline.
If I really have to spell it out, so to speak, I'd say:
while diamond, start block.
ess for'd slash literal foo for'd slash literal bah for'd slash gee, semi-colon.
print dollar underscore bar bar double quotes literal capital N, nothing; newline. close double quotes, semi-colon.
close block.

But I don't often have to spell code out like that.

I'd pronounce qq~...~; as queue queue tilde <whatever> tidle semi-colon, or preferably double quotes (queue, queue tilde) whatever end quotes.

# is hash or comment % is percent ! is shriek or bang ^ is caret or hat * is star
my punctuation pronounciation is rather boring.

jarich


In reply to Re: Spoken Code by jarich
in thread Spoken Code by andyf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found