Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

2 views
Skip to first unread message

Parag Kalra

unread,
Dec 23, 2009, 7:53:51 AM12/23/09
to Perl Beginners
Hello All,

Uptil 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 uptil 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.

Cheers,
Parag

Shawn H Corey

unread,
Dec 23, 2009, 9:34:30 AM12/23/09
to Parag Kalra, Perl Beginners

“Show me your flowcharts and conceal your tables, and I shall continue
to be mystified. Show me your tables, and I won’t usually need your
flowcharts; they’ll be obvious.”
Frederick P. Brookes, Jr., _The Mythical Man-Month_

A lot of my work is data munging so YMMV. But when I start coding, I
write down the data structure of the input and the data structure of the
output. I then create any required internal data structures. After
that, it's as the man said, it becomes obvious; it's just a matter of
connecting the dots.

Of course, knowing how to build complex data structures in Perl is a big
plus. See these perldocs for help:

perldata http://perldoc.perl.org/perldata.html
perldsc http://perldoc.perl.org/perldsc.html
perllol http://perldoc.perl.org/perllol.html

The general rule of thumb is: if the order is important, use an array;
otherwise use a hash.

Also, don't store more than one reference to an item in your data
structures. This can cause circular references. Use the hash key (or
array index) to indirect link items.


--
Just my 0.00000002 million dollars worth,
Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

Shlomi Fish

unread,
Dec 23, 2009, 4:09:56 PM12/23/09
to begi...@perl.org, Parag Kalra
Hi Parag!

In addition to what Shawn said, here is what I know.

On Wednesday 23 Dec 2009 14:53:51 Parag Kalra wrote:
> Hello All,
>
> Uptil 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 uptil 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.

I'm not aware of any tools specific to Perl, at least not open-source.
However, there are some more generic tools that can be used for Perl code.

>
> 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.
>

Well, I personally am aware of the following:

1. http://www.inkscape.org/ - a wonderful drawing program, but may not be very
suitable for diagrams. In a very good shape and under active development. You
should check it out and play with it anyway because it's very useful.

2. http://projects.gnome.org/dia/ - a diagram editor (similar to Visio) that
can do UML diagrams. Has many quirks and missing features, and has been
suffering from a lot of neglect. It still may be of some use though.

3. http://www.koffice.org/kivio/ - similar to Dia only part of the KDE
project. Haven't really taken a look at it for a long time.

4. http://en.wikipedia.org/wiki/List_of_Unified_Modeling_Language_tools -
contains a list to many open source UML programs. Don't know if any of them
support Perl, but you can always create a UML diagram and then translate it to
Perl manually.

--------------------

I should note that I've only tried using Dia and Inkscape for some simple
diagrams so far. I don't normally draw extensive diagrams for my code, and
just let it evolve "organically" - with a lot of mental design, refactoring
and maybe some informal diagrams.

Shawn's point about data-structures vs. algorithms is instructive, especially
considering:

http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral-
bazaar/ar01s06.html

(short URL - http://xrl.us/bgq2zj ).

The tools I mentioned should allow you to model data-structures too, though.

Regards,

Shlomi Fish

> Cheers,
> Parag
>

--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Best Introductory Programming Language - http://shlom.in/intro-lang

Bzr is slower than Subversion in combination with Sourceforge.
( By: http://dazjorz.com/ )

0 new messages