Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Tool used by Perl developers to design the flow of Perl Projects

by paragkalra (Scribe)
on Dec 23, 2009 at 13:02 UTC ( [id://814088]=perlquestion: print w/replies, xml ) Need Help??

paragkalra has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,

Up till now I have been coding fairly simple Perl scripts.

Lately I have started designing some complex scripts. And I always felt that if you place the logic and flow of the script on paper first then coding part is simplified to a great extent. And up till now I have mainly used pen and paper for it. :)

Was just wondering if there is any graphical tool (of course opensource :)) specific to Perl to design the flow of the Perl script projects before we actually start coding it.

Using it I should be able to design something similar to flowcharts and should be able to share it with others to get it reviewed.

So just wanted to know which tool does Perl developers use in general to design the flow of the Perl projects.

TIA

Parag

Replies are listed 'Best First'.
Re: Tool used by Perl developers to design the flow of Perl Projects
by jonadab (Parson) on Dec 23, 2009 at 14:56 UTC

    You could try a top-down approach: code the overall logic first, with the details simplified into function calls, and then go back later and write the functions (which can themselves contain function calls, to functions that you can write later...).

    Yeah, I know, that's not all visual and graphical and multimedia and cool and stuff. Nonetheless, it works reasonably well for most purposes.

    -- 
    We're working on a multi-year set of freely redistributable Vacation Bible School materials.
Re: Tool used by Perl developers to design the flow of Perl Projects
by Old_Gray_Bear (Bishop) on Dec 23, 2009 at 15:58 UTC
    Personally, I find that the most helpful thing when I am maintaining a "complex script" is to have a block of comments detailing the program input structure(s) and the expected output structure. Once you know where you start and where you want to go, the path becomes luminously clear. There is a line from Fred Brooks's (The Mythical Man Month) to the effect that flow charts are pretty pictures, but to understand what the code does, show me the tables. (My copy of MMM is in storage at the moment, so I am paraphrasing from leaky memory.)

    ----
    I Go Back to Sleep, Now.

    OGB

      See my answer on the Beginners Perl mailing list.

Re: Tool used by Perl developers to design the flow of Perl Projects
by ganeshwari (Sexton) on Dec 23, 2009 at 16:02 UTC
    Designing Flow chart is not specific to any programming language or scripting language. Flow chart should be common and should show the logic clearly. Using that flow chart we can develop the code in any language. This is my view. May i know why you need the tool which is specific to perl for flow chart design ?
    Ganeshwari

      Agreeing with the above that it's entirely independent of language used anyway, I figured I'd mention Dia for doing charts and whatnot. Maybe this is in the right direction.

Re: Tool used by Perl developers to design the flow of Perl Projects
by moritz (Cardinal) on Dec 24, 2009 at 09:49 UTC
    Let me start by apologizing for not really answering your question.

    There are basically two kinds of flow charts: One describes an algorithm (instead of using pseudo code; a good example is here, the other gives a high-level overview over how different components interact in a complex application.

    As has been pointed out, both are language independent.

    And the second one is usually a lie.

    Most complex programs these days are object oriented, and that means that that whenever you obtain data from an object outside your own class/package/module, you call a method from another class or object. So a real-world application crosses the border between classes thousands of times, instead of having a smooth border that is crossed once or twice.

    Instead of showing the control flow, it would be far more interesting to know what objects are shared between subsystems, or through which objects subsystems interact with each other.

    Which brings me to my main point: For a complex system, a detailed flow chart is usually too complicated to show anything of interest, and a simplified flow chart is usually a lie and often not helpful either.

    So if your program is getting so complex that you lose overview over the control flow, it might very well be a sign that you could use a better approach. Like objects which don't care very much about control flow, because they are well encapsulated.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re: Tool used by Perl developers to design the flow of Perl Projects
by RAS230 (Acolyte) on Dec 25, 2009 at 03:54 UTC
    Personally, I also tend to start with a text description of what I want the script to do which I then break down until I end up with a mix of pseudo code and comments, but in the past I've also created flow-chart type things.

    I never used a program to do it, just a large dry erase board, a marker, and some larger sized post-its.

    Its simple to use and takes almost no time at all to get started. I can move things around quickly, draw/redraw lines between notes, stack notes on top of other ones, or replace notes all together.

    I think if I had used some kind of visio-type program I would have spent all my time playing with different boxes/borders/fonts/colors or at least spent time learning the ins and outs of the software itself when what I really wanted was to get to work solving the problem at hand.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://814088]
Approved by AnomalousMonk
Front-paged by redgreen
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-28 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found