By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,458 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

Does anyone flowchart their code?

P: n/a
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
Jun 27 '08 #1
Share this Question
Share on Google+
19 Replies


P: n/a
William Gill wrote:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
No. flowcharts and Nassi diagrams were meant for procedural programming.
They come from the time that a program was a "recipe", starting at line
1 and going all the way to line 3456821. I never understood Nassi
diagrams: they are extremely hard to read and even harder to draw. I can
make a program in 1% of the time it would cost me to make the
corresponding Nassi diagram. And afterwards, only the program can be
corrected...

I draw UML diagrams for the parts that need them and put them in my unit
tests (along with other documentation). So every time you run the tests,
you see that the code is documented. The rest of my documentation
accompanies the code or is in the code itself. My code should be
self-explanatory, and if not, the documentation is in the appropriate
section of the module in subversion.
Jun 27 '08 #2

P: n/a
In article <7T************@fe119.usenetserver.com>,
William Gill <no*****@example.comwrote:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
I haven't done flow charts since 1968. And even then it was just using
pencil and paper. The times my stuff became convoluted (or I had to use
someone else's convoluted mess), I decided it was time to rewrite from
scratch, starting with a specification. The spec doesn't need to be
formal in any way, just a list of requirements. Then you can decide on
the model, approach, and structure. I find this suffices, usually.

Of course, this may not work if you're part of a larger team. But I've
generally managed to avoid that.
Jun 27 '08 #3

P: n/a
On Sun, 15 Jun 2008 12:58:33 -0400, William Gill wrote:
I seem to be having a mentally bad period lately . My code is
beginning to be terrible convoluted mess, and I shudder to think
what it will be like to go back in a couple months and try to follow
it, so I'm going back to basics. I need to flowchart what I'm doing.
The problem is I can't seem to find anything that works well,and
doesn't cost an arm and leg. I have an old copy of Smart Draw, but
it's out dated and does not work right on WinXP. I seem to remember
Nassi-Shneiderman Diagrams were intended to be implemented via word
processors, but I haven't done one in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
I do. I have a nice plastic template that says it was made in 1975,
and a box of cheap mechanical pencils. Two or three redraws and I've
usually got things well enough organized to move on to writing code.
Flowcharting software just mades it too easy to amend the chart to match
the code, and then end up with spagetti programs and spagetti charts to
match.

--
_ o
|/)
Jun 27 '08 #4

P: n/a
Peter H. Coffin wrote:
>
I do. I have a nice plastic template that says it was made in 1975,
and a box of cheap mechanical pencils. Two or three redraws and I've
usually got things well enough organized to move on to writing code.
Flowcharting software just mades it too easy to amend the chart to match
the code, and then end up with spagetti programs and spagetti charts to
match.
How old school!

I've got a couple of those around somewhere, if I can just remember
where I used them last.

Ah! Here they are. What's this about punched tape and punched cards?
Talk about old school.

Jun 27 '08 #5

P: n/a
William Gill wrote:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
I'm with Dikkie. I design and document the design before writing code.
But I do it using OO methodologies.

I may not have a complete detailed spec for every single class - i.e.
database-related classes may have some shortcuts. But I still document
first, code later.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 27 '08 #6

P: n/a
on 06/15/2008 01:58 PM William Gill said the following:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
I think the problem is that you are focusing in code rather than in the
project.
--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jun 27 '08 #7

P: n/a
Manuel Lemos wrote:
on 06/15/2008 01:58 PM William Gill said the following:
>I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?

I think the problem is that you are focusing in code rather than in the
project.

The design is the way you ensure the code matches the requirements of
the project.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 27 '08 #8

P: n/a
Hello,

on 06/15/2008 01:58 PM William Gill said the following:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
I think the problem is that you are focusing in code rather than in the
project.

Flow charts may be OK for trivial projects, but for larger projects you
need to specify and plan the implementation before you start or else you
will stumble into many needs that were not anticipated, and may make you
take a different approach.

Traditional good practices are proposed by RUP (Rational Unified
Project) on which you can plan your project in implementation in terms
of use cases.

Before you ever get to the code, it is useful to draw some use case
diagrams or sequence diagrams. Then you can narrow the details by
documenting the use case steps, exceptional situations that you need to
handle, pre-conditions, post-conditions, etc.

Then you finally can start modeling you application data objects and
write code to implement the use cases.

Personally I use a methodology named Use Case Mapping to depart from use
case documentation to a PHP project implementation. You may want to read
this article about the subject. If you are not familiar with concepts
such as UML, Use Cases, RUP, etc., this document gives you a good
overview on the subject as well describes a practical implementation.

http://www.meta-language.net/metastorage-example.html

As for modeling tools, I recommend any good UML tool. UML defines a set
of visual artifacts to describe your application diagrams, such as use
case diagrams, sequence diagrams, class diagrams, entity-relationship
diagrams, etc..

Under Linux I use Umbrello. Umbrello can also run on Windows and Mac
using a KDE installation for those systems.

http://uml.sourceforge.net/index.php

I think there are other free UML tools for Windows and Mac based in Java
like Poseidon.

http://www.gentleware.com/products.html

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jun 27 '08 #9

P: n/a
On Jun 15, 6:23 pm, Dikkie Dik <dik...@nospam.orgwrote:
William Gill wrote:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.
So, does anyone flowchart anymore? If so what do you use/suggest?

No. flowcharts and Nassi diagrams were meant for procedural programming.
They come from the time that a program was a "recipe", starting at line
1 and going all the way to line 3456821. I never understood Nassi
diagrams: they are extremely hard to read and even harder to draw. I can
make a program in 1% of the time it would cost me to make the
corresponding Nassi diagram. And afterwards, only the program can be
corrected...

I draw UML diagrams for the parts that need them and put them in my unit
tests (along with other documentation). So every time you run the tests,
you see that the code is documented. The rest of my documentation
accompanies the code or is in the code itself. My code should be
self-explanatory, and if not, the documentation is in the appropriate
section of the module in subversion.
Flot charts still have their place in OO development. In my
experience I've run into situations where I know I need method foo to
work on inputs bar and baz and output quux, but can't quite visualize
how to get from one state of affairs to the other. Here is where a
quickly doodled flow-chart can come in handy, it can help you get a
method's internal logic straight in your own head without having to
worry about the semantics of the language until you actually implement
it.

I really don't think I'd recommend flow charts as a formal method or
go looking for software to manage them, but to hel pyou solve a
specific problem they can help you organize your thought processes.
As for the software I use for making a flowchart, I'm a big advocate
of pen and paper 1.0.
Jun 27 '08 #10

P: n/a
On Jun 16, 2:58 am, William Gill <nore...@example.comwrote:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
Reading these comments I must be crazy.

Since when is a flow chart not extremely useful? It all depends on how
you use them, for me they are used to visualise the programs
"flow"...funny that.

So if a user logs in, what happens if they fail validation or fail to
authenticate. What happens if they succeed? Do I log a value to file,
update a database or set some variables etc

This has nothing to do with UML, it's a totally separate thing.
Jun 27 '08 #11

P: n/a
William Gill wrote:
I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
A pencil and a roll of plain wallpaper is hard to beat.
Jun 27 '08 #12

P: n/a
The Natural Philosopher schreef:
William Gill wrote:
>I seem to be having a mentally bad period lately . My code is
beginning to be terrible convoluted mess, and I shudder to think what
it will be like to go back in a couple months and try to follow it, so
I'm going back to basics. I need to flowchart what I'm doing. The
problem is I can't seem to find anything that works well,and doesn't
cost an arm and leg. I have an old copy of Smart Draw, but it's out
dated and does not work right on WinXP. I seem to remember
Nassi-Shneiderman Diagrams were intended to be implemented via word
processors, but I haven't done one in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
A pencil and a roll of plain wallpaper is hard to beat.
Yes, same here.
I like your wallpaper analogy, since I always run short on normal paper
during designing. Write, strikeout, move, rename, etc. ;-)

Personally I always start with designing the database, and check the
requirements for the project all the time during the designing.
Once you visualize the database, you easily see where more flexibility
is needed, which extra (unexpected) requirements are easily added, what
requirements are difficult to add, etc.
Once done I take that result back to the client, and talk it over.
The databasedesign is the heart of every application I write.

I did have a look at UML, but that is just too much for me.
Allthough UML surely makes sense in large projects where many
programmers are active.

So, yes: experience + enough wallpaper is enough for me. :-)

just my 2 cent.
Regards,
Erwin Moller
Jun 27 '08 #13

P: n/a
Erwin Moller wrote:
The Natural Philosopher schreef:
>William Gill wrote:
>>I seem to be having a mentally bad period lately . My code is
beginning to be terrible convoluted mess, and I shudder to think what
it will be like to go back in a couple months and try to follow it,
so I'm going back to basics. I need to flowchart what I'm doing.
The problem is I can't seem to find anything that works well,and
doesn't cost an arm and leg. I have an old copy of Smart Draw, but
it's out dated and does not work right on WinXP. I seem to remember
Nassi-Shneiderman Diagrams were intended to be implemented via word
processors, but I haven't done one in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
A pencil and a roll of plain wallpaper is hard to beat.

Yes, same here.
I like your wallpaper analogy, since I always run short on normal paper
during designing. Write, strikeout, move, rename, etc. ;-)
No analogy: when face d with 5 years of hacked legacy BASIC code, that
is exactly what a friend of mine did.

When she left a couple of years later, it was still pinned to the wall.
Jun 27 '08 #14

P: n/a
Michael Sharman wrote:
Reading these comments I must be crazy.

Since when is a flow chart not extremely useful? It all depends on how
you use them, for me they are used to visualise the programs
"flow"...funny that.

So if a user logs in, what happens if they fail validation or fail to
authenticate. What happens if they succeed? Do I log a value to file,
update a database or set some variables etc

This has nothing to do with UML, it's a totally separate thing.
Thanks Michael, I was beginning to think it was just me. I see all
these references to "design" and "focusing on the project not the code",
and am at a loss how they handle and organize the "design" if not some
sort of diagram even if not a flowchart per se. My problem (lately)is
jumping in and out without some overall organizational structure results
in unorganized (i.e. convoluted) code. I don't have the luxury of
sitting down and finishing what I start in any one sitting, so I need to
have something to "hold" the pieces together until done.

I have coded both sequential and oo, but I need to organize my project
visually to see what's happening (or supposed to happen). Even in oo
the user can be expected to follow some logical "work flow", not to
mention that methods are usually sequential "recipes."

I must admit, I'm unfamiliar with UML, and glancing at several
references I don't really see much difference between say a use case
diagram ( for example
http://atlas.kennesaw.edu/~dbraun/cs.../use_case.htm),
and a flow chart, with the exception that the user isn't locked into a
rigid sequence. However even the instructions for drawing a use case
diagram begin "Start by listing a sequence of steps a user might take..."

I rely heavily on paper/pencil with and without templates (I really
don't care in a decision symbol is perfect, as long as it's
recognizable), the problem with paper media is I am designing as I'm
organizing, and things need to be regularly rearranged an I flesh out my
thoughts, or discover oversights. That isn't so easy on paper media.
Jun 27 '08 #15

P: n/a
William Gill wrote:
Michael Sharman wrote:
>Reading these comments I must be crazy.

Since when is a flow chart not extremely useful? It all depends on how
you use them, for me they are used to visualise the programs
"flow"...funny that.

So if a user logs in, what happens if they fail validation or fail to
authenticate. What happens if they succeed? Do I log a value to file,
update a database or set some variables etc

This has nothing to do with UML, it's a totally separate thing.

Thanks Michael, I was beginning to think it was just me. I see all
these references to "design" and "focusing on the project not the code",
and am at a loss how they handle and organize the "design" if not some
sort of diagram even if not a flowchart per se. My problem (lately)is
jumping in and out without some overall organizational structure results
in unorganized (i.e. convoluted) code. I don't have the luxury of
sitting down and finishing what I start in any one sitting, so I need to
have something to "hold" the pieces together until done.

I have coded both sequential and oo, but I need to organize my project
visually to see what's happening (or supposed to happen). Even in oo
the user can be expected to follow some logical "work flow", not to
mention that methods are usually sequential "recipes."

I must admit, I'm unfamiliar with UML, and glancing at several
references I don't really see much difference between say a use case
diagram ( for example
http://atlas.kennesaw.edu/~dbraun/cs.../use_case.htm),
and a flow chart, with the exception that the user isn't locked into a
rigid sequence. However even the instructions for drawing a use case
diagram begin "Start by listing a sequence of steps a user might take..."

I rely heavily on paper/pencil with and without templates (I really
don't care in a decision symbol is perfect, as long as it's
recognizable), the problem with paper media is I am designing as I'm
organizing, and things need to be regularly rearranged an I flesh out my
thoughts, or discover oversights. That isn't so easy on paper media.
As I said - I do everything in UML diagrams. This includes function
calls, which effectively provides a flowchart. But if a function is
complex enough that you need to flowchart it, chances are it's a good
idea to break it up into smaller functions - which will be more
maintainable.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 27 '08 #16

P: n/a
Jerry Stuckle wrote:
>
As I said - I do everything in UML diagrams. This includes function
calls, which effectively provides a flowchart. But if a function is
complex enough that you need to flowchart it, chances are it's a good
idea to break it up into smaller functions - which will be more
maintainable.
I don't necessarily chart each step in the function/methods, but I do
show calls to them, and black box them; what inputs go in, what outputs
come out, all FM inside(old Navy term, second word is magic). As I
said, I can get a good overview using a flowchart, and I man notice I
have left out a requisite functions like "ordering" before "paying".
All of which is done before one syllable of "code" is done, using pseudo
code phrases. It sometimes helps me determine what language to code in.
Jun 27 '08 #17

P: n/a
William Gill wrote:
Jerry Stuckle wrote:
>>
As I said - I do everything in UML diagrams. This includes function
calls, which effectively provides a flowchart. But if a function is
complex enough that you need to flowchart it, chances are it's a good
idea to break it up into smaller functions - which will be more
maintainable.

I don't necessarily chart each step in the function/methods, but I do
show calls to them, and black box them; what inputs go in, what outputs
come out, all FM inside(old Navy term, second word is magic). As I
said, I can get a good overview using a flowchart, and I man notice I
have left out a requisite functions like "ordering" before "paying". All
of which is done before one syllable of "code" is done, using pseudo
code phrases. It sometimes helps me determine what language to code in.
Yep, I'm not much different - except I will say WHAT goes on inside the
function. I just won't worry HOW it's done.

Then when I get down to coding the function, if it's getting too
complicated, I split it into multiple functions (and update the UML
diagrams, of course).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 27 '08 #18

P: n/a
Erwin Moller wrote:
>The Natural Philosopher schreef:
>>William Gill wrote:
I seem to be having a mentally bad period lately . My code is
beginning to be terrible convoluted mess, and I shudder to think
what it will be like to go back in a couple months and try to
follow it, so I'm going back to basics. I need to flowchart what
I'm doing. The problem is I can't seem to find anything that works
well,and doesn't cost an arm and leg. I have an old copy of Smart
Draw, but it's out dated and does not work right on WinXP. I seem
to remember Nassi-Shneiderman Diagrams were intended to be
implemented via word processors, but I haven't done one in 30
years. So, does anyone flowchart anymore? If so what do you
use/suggest?
A pencil and a roll of plain wallpaper is hard to beat.

Yes, same here.
I like your wallpaper analogy, since I always run short on normal
paper during designing. Write, strikeout, move, rename, etc. ;-)

No analogy: when face d with 5 years of hacked legacy BASIC code, that
is exactly what a friend of mine did.

When she left a couple of years later, it was still pinned to the
wall.
LOL! I haven't heard "pencil and a roll of wallpaper" since my intro to
FORTRAN & COBOL back in the 60's!
Jun 27 '08 #19

P: n/a
Twayne wrote:
>Erwin Moller wrote:
>>The Natural Philosopher schreef:
William Gill wrote:
I seem to be having a mentally bad period lately . My code is
beginning to be terrible convoluted mess, and I shudder to think
what it will be like to go back in a couple months and try to
follow it, so I'm going back to basics. I need to flowchart what
I'm doing. The problem is I can't seem to find anything that works
well,and doesn't cost an arm and leg. I have an old copy of Smart
Draw, but it's out dated and does not work right on WinXP. I seem
to remember Nassi-Shneiderman Diagrams were intended to be
implemented via word processors, but I haven't done one in 30
years. So, does anyone flowchart anymore? If so what do you
use/suggest?
A pencil and a roll of plain wallpaper is hard to beat.
Yes, same here.
I like your wallpaper analogy, since I always run short on normal
paper during designing. Write, strikeout, move, rename, etc. ;-)
No analogy: when face d with 5 years of hacked legacy BASIC code, that
is exactly what a friend of mine did.

When she left a couple of years later, it was still pinned to the
wall.

LOL! I haven't heard "pencil and a roll of wallpaper" since my intro to
FORTRAN & COBOL back in the 60's!

I have learnt a lot over the years.

Faced with installing some gateposts in the garden, I asked around.
Hiring a motorized auger to drill into the soil..or a mini digger to
excavate a huge hole..using a JCB to push the thing in..

In the end I took a spade and dug a square hole..as it got deeper I
simply used the spade to loosen the soil, and scooped it out with the
gardening equivalent of a bent spoon. (hand dutch hoe). When I got to
the full strtech of ny arm lying on the soil I considered it deep
enough. Posts in, then a mallet used endways to ram the soil back around.

It took about an hour per post. Considerably less time than finding
someone with the correct tool to hire.

There has been more than one occasion when someone has asked me to
recommend a 'computer system' and I have looked at what they wanted, and
gone out and bought them a filing cabinet full of paper hangers..or a
card index file.

People are so conditioned to think that the only way is the high tech
way that they forget to analyse what it is they are actually trying to
achieve.
Jun 27 '08 #20

This discussion thread is closed

Replies have been disabled for this discussion.