I write code for physics research, and since my programs often have run times of months I find myself developing an incredibly strict style.

If I know an idiom that turns a task into a oneliner, I use it; if I don't I try to find or reason one out that I can add to my "dialect" and further cut my code. The goal is brevity. I want to be able to read my code as a few lines of colloquial instructions, all of which are familiar.

I always use warnings; use strict; use diagnostics in every script. I write the script, debug it, and then write either a commented header or a POD document telling what it does and how to use it. I never actually comment my code, since it's all in my dialect.

grep, map, and such don't see the light of day that often in my code just because I have little use for them. sort occasionally comes up. My data is usually in files being operated on my FORTRAN programs, or is in piddles under PDL. I got to use sort yesterday to arrange the frequencies of emitted photons in n=3 to n=2 transitions in hydrogen with fine structure corrections yesterday, but that was more for aesthetic reasons than need. Physics seems to be order independent...


In reply to Re: What is your Perl dialect? by Anonymous Monk
in thread What is your Perl dialect? by webfiend

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.