Quote:
|
Originally Posted by Void
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.