Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Developing a module, how do you do it ?

by BrowserUk (Patriarch)
on Feb 29, 2012 at 05:40 UTC ( [id://956862]=note: print w/replies, xml ) Need Help??


in reply to Re: Developing a module, how do you do it ?
in thread Developing a module, how do you do it ?

Somewhere in the Home Counties circa. 1930.

Lady Jane picks up the telephone receiver, "jiggles" -- she was assured that was the right term -- the contact "thingy" on the cradle -- she knew that wasn't the right term, but no one seemed to know what it was called -- a few times.

Placing the receiver close to her ear, she waited. Presently, she heard the unfamiliar, but renowned, shrill squealed greeting of the County telephonic operator -- the Estate operator really; but since the Estate encompassed pretty much the entire county, they very much were one and the same thing.

"Oper'ta. 'ho can I get for yur love?"
"Good morning. Mrs Patterson. And how are you today?"

she enquired. Civility & proprietary, hallmarks of her breeding, she thought.

"Oh M'lady. I'm ... I'm very well. Thank you M'lady. Sorry, When your line rang I assumed it would be Tollerson calling, I ..."

Cutting her off.

"No matter, Mrs Patterson. I wonder if you would be so kind as to put me in touch with my husbands office."
"Of course M'Lady. Right away. Won' be buta jiffy..."

She could hear frantic activity and indiscernible snippets of hushed conversation at the other end.

"Oh, and Mrs Patterson, since it is becoming the done thing to use the infernal contraptions oneself, and we are likely to be talking to each other on a more regular basis from now on, do drop the "M'lady". Call me Lady Jane. It it the 19030s all said and done".
"Of course M'l.. I mean Lady Jane. Thank you M ... Um Lady Jane. Would ya mind 'olding for a few seconds, I need to talk to the receptionist at t'other end.
"Certainly".

A few seconds went by.

"Okay Lady Jane, I'm putting you through to Miss Frobershire now. Go ahead caller."
"Hello", Lady Jane enquired tentatively.
"Hello, Lady Jane, Miss Frobershire here. How may I help you?"
"I wonder if you could convey a message to my husband for me?"
"Perhaps I could put you through to his secretary, Mrs Lyons?"
"Oh yes. That's a very good idea. Please do."
"Okay, please hold."
"Oh and .."

but the lne was dead. She waited and after a few moments she heard.

"Mrs Lyons, I have Sir John's wife, Lady Jane on the line for you."
"Hello? Lady Jane. Is something wrong?"
Enquired Mrs Lyons.
"No no. I just wanted to get a message to my husband. Nothing terribly urgent, but he told me that I really should make the effort to use this thing. We apparently pay quite a lot of money for the privilege of having it, and it sits here day and night mostly doing nothing."
"I see Lady Jane, well Sir John is in a meeting with the PM right now, I don't think that I should interrupt him if it isn't urgent."
"No, not urgent at all. Perhaps you could take a message and see he gets it?"
"Of course Lady Jane. How would you like the message to read?"
"Please ask him to swing by Fortnum & Masons and pick up a jar of their wonderful Potted Shrimps, only his mother is calling in for tea tomorrow and she does so love them."
"Is that all Lady Jane?"
"Yes... er. rather no. Could you also ask him not to be late home this evening as the Fothering-Smythes are coming for dinner and they are such a bore. I need him here to prevent me falling asleep in my soup course."
"Certainly Lady Jane. Is that all?"
"Yes. Thank you, Mrs Lyons. That's all. Goodbye."
"Goodbye Lady Jane".

The line went dead. "What do I do now?", she though. And settled upon replacing the receiver on its cradle.

Leap forward 80 years to present day.

Jane picked up her cellphone, swiped it unlocked and touched the contacts app. Swiped down until she found her boyfriends number, touched the txt icon and typed: "Pick up takeaway on your way home -- Chinese or Indian. XXX" and hit send.

"I probably should have abbreviated some of that, but it always takes me longer to decide how to abbreviate it than to type it in full.", she thought smiling to herself. "How old fashioned I am.". And proceeded to the next task on her to-do list.


We programmers have revolutionised and (in most cases) simplified the operating procedures of virtually every industry on earth. Except our own, which has gotten stuck somewhere in the 1970s, Same tools; same working procedures; same labour intensive, manual step 1; manual step 2; manual step 3, .... go to step 1; that we've being following for the last 30+ years. Except the list of steps has become longer.

With Perl, we got rid of two steps (compile & link), but then introduced six more by way of compensation.

There has to be a better way. There *is* a better way -- and no, I'm not talking about GUI-IDEs with code wizards. But certainly some of the functionality of the better ones would be a good start.

  • When I save a source file, it gets syntax checked immediately and automatically and moves the cursor in my editor directly to the line of the first error, if there are any.
  • When the compile is clean, it puts it straight into the CVS-equivalent and then invokes the test suite.
  • If a test fails, the test suite stops, and the appropriate test file is loaded directly into my editor at the failing line with the failing output displayed nearby.
  • When the test suite passes, it installs the module automatically into the development library.
  • We can now switch to the source buffer of the program that uses it and try it out.

And pigs will fly, world hunger will end and all will be right with the world :)

  • Comment on Re^2: Developing a module, how do you do it ?

Replies are listed 'Best First'.
Re^3: Developing a module, how do you do it ?
by Anonymous Monk on Mar 01, 2012 at 03:42 UTC

    There *is* a better way...

    How'd you do that?

      How'd you do that?
      • I develop my modules located within the site/lib structure.
      • I embed the tests within the module after
        return if caller; package main; # tests here

        Thus, when run as a script: perl \perl\site\lib\my\module.pm, the tests are run.

        My editor has the facility to run the current file supplying the full pathname. The results are logged directly into another editor pane.

        Clicking an error message that contains a line number switches me to that pane/line number (loading the file first if it isn't already loaded).

      • I don't use perl Test::* packages or prove etc, because they:
        1. Steal my stdout/stderr output;
        2. and/or futz with it in ways that prevent me from seeing it in real time;

          For example, prevent me from using ^S to pause the program run whilst I check things: Memory usage, open file and other OS handles; file output; etc.

        3. Require me to force fit all my tests in dumb boolean ok/nok outcomes.
        4. Seem mostly concerned with producing a bunch of meaningless statistics I have no use whatsoever for.
        5. Generally interpose themselves between me and my code, forcing me into a most unnatural, clumsy and laborious way of working for the sake of a set of 'benefits' that I do not see the value of.

      • Finally, if and when I get a module to the state where I think it might be useful to others, then I will consider 'packaging' it.

        At which point I will do the absolute minimum required to allow it to be uploaded to CPAN and installed via that mechanism.

        Prior to that point, the whole archaic, ill-fitting blib structure, and make/test/install working practice is nothing more than a drag on my time. A pain to set up; a chore to maintain; and little more than make-work to operate.

      • I do not currently use source control software.

        I have set up several different flavours of it here over the past few years -- svn; mecurial; darcs -- but as I tend to prefer not to collaborate with others, I find their benefits minimal and far outweighed by the affect they have upon my working practices and productivity.

        One day someone will write the perfect source control package and I will use it. Instead of forcing me to work to its agenda, path structures etc. it will fit to mine. It will run on startup and sit in the background with an icon in the task area.

        When I want to have it control something, I will pop up an explorer dialog and click on one or more paths in my file system. And then I am done. From that point on, it will monitor all those directories and when a new file (or directory) appears or a file within them changes, it will do its thing. And each time they change, it will do its thing.

        No further action required from me. Until I want to revert a file, at which time I'll click the icon, locate the file or directory I wish to revert and then it will allow me to click back through the changes made until I reach the point I wish to revert to. Click doit, and it will be done.

        Maybe I'll write it one day :) (And pigs might fly, world hunger will end and all will be right with the world :)


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

Re^3: Developing a module, how do you do it ?
by sundialsvc4 (Abbot) on Feb 29, 2012 at 18:59 UTC

    One of your best.   “++

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found