Jump to content

Flowcharts

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
16 replies to this topic

#1
Void

Void

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 411 posts
Do you create flowcharts for your software before you create it? In school we were taught to make these before we ever did any actual work. Now, I never create flowcharts and my programs seem just fine. I understand what they are for and how they can help I just usually don't know how I'm going to work any of the code before I code.

If you do do flowcharts:
Do you do the entire program in one flowchart or do you do each class?
Are they worth doing?
Do you update them when you make changes?
Void

#2
smith

smith

    Programmer

  • Members
  • PipPipPipPip
  • 153 posts
Yup, I do create flowcharts before each program.

Yes, entire program first
Yes, they help you spot where you can use OOP
No, lol :) - I often do not.

Here is you some software to do it automatically. Not sure how well that would work though:

http://www.softplatz...-Flowchart.html

for (int i;;) {

   cout << "Smith";

}


#3
Void

Void

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 411 posts
I don't think an auto-flow charter would work to well :eek:

Anyone else?
Void

#4
Guest_Kaabi_*

Guest_Kaabi_*
  • Guests
An auto-flow charter? I don't see any way that would be able to work. I've never made a flow chart before, but that's because I've never made a long program.

#5
Guest_koolkid_*

Guest_koolkid_*
  • Guests
I agree, they seem like a waste of time for most projects unless it is very big and complicated

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts

Void said:

Do you create flowcharts for your software before you create it? In school we were taught to make these before we ever did any actual work. Now, I never create flowcharts and my programs seem just fine. I understand what they are for and how they can help I just usually don't know how I'm going to work any of the code before I code.

If you do do flowcharts:
Do you do the entire program in one flowchart or do you do each class?
Are they worth doing?
Do you update them when you make changes?

I used to feel the same way you do, back in '89 and '90 when I was programming in Pascal. I took a look at a couple games I wrote recently and was horrified at the mess my code was in, along with the unnecessary work I did adding parameters to function calls as I added features.

Yes, Yes, and Yes.

For the best flowcharting program I've ever found, go to http://www.dynamicdraw.com/index.html it has a bit of a learning curve to it but allows you to do version tracking on your flowcharts.

As a practical example of why flowchart:
For a text game like Yahtzee, it's easy to see that you have a loop in which you roll the dice, then decide a few times about rerolling, then score your roll. Drawing this stuff out is easy, and the function calls are pretty straight-forward.

Now, consider playing chess (or go, which is what I'm working on now). Suddenly you have to deal with flags for whether a pawn can be captured en-passant this turn, whether the king can castle with a particular rook, storing how each piece moves, etc, etc, etc. Flow charting allows you to organize the mass of information before you start worrying about pesky things like coding details. It also lets you check the logic.

Most classroom projects don't really need a flowchart until you're so badly weaned off them that you crash hard when you DO need one.

#7
Chan

Chan

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 204 posts
I'm still new to programming, what are flowcharts?

#8
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Flowcharts are diagrams that are used to represent the sequence of processing in a program. The idea is to use them to get the program mapped out in an informal way before you worry about the actual coding, with all the syntax issues that came come up there. Another planning tool is pseudocode, where you sketch out the commands in something similar to English, but with the idea that you'll be able to translate it into code easily.

#9
forumnewbie

forumnewbie

    Newbie

  • Members
  • Pip
  • 7 posts
taking flowcharts a bit further, if you are working on a big project, something like UML (especially for OOP languages) can be really beneficial.

#10
kromagnon

kromagnon

    Learning Programmer

  • Members
  • PipPipPip
  • 50 posts
I know this sounds horrible, but I don't do ANYTHING. I just sit down and start coding before I do anything else. Let the flaming begin.
<!-- comment comment comment --></

#11
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Kromagnon, for small projects that works fairly well. If you write your programs in a disciplined way, you can even make that work for somewhat larger projects. After a while, though, it all catchs up with you.

I remember when I made my Yahtzee program. I wrote it with no planning. Then I'd realize I needed another parameter in a function, and have to change ALL the function calls for that function. Then I'd make another change and do it again. Then I decided to add a new feature... and had to change a BUNCH of function calls. Repeat for a while. If I had planned it out in advance, I could have coded each call once and not had to search through all my code looking for bad function calls.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#12
Guest_Kaabi_*

Guest_Kaabi_*
  • Guests
When writing a large program it's imperative to have a plan, and WingedPanther provided the perfect example. Sorry you had to go through that, must've been frustrating.