PDA

View Full Version : Program Planning Process/Docs



Jamesb187
04-17-2006, 07:26 AM
Hi all,

Another newbie question from me!

I'm putting together my first simple games programs (Hangman, word games etc) to practice basic coding, and I'm finding that I spend a lot of time backtracking in my code because I haven't thought ahead through all of the program control ie oops, I need a do...while loop here, I need a new function here...which is wasting a lot of time.

Is there a process or document that you might use before starting any coding, to plan program flow, required functions/variables/arrays etc? I get the feeling that, especially for more advanced programs/games, this must be required to save hours of recoding as the game is written.

Any ideas on how to plan effectively would be much appreciated!

Thanks,

Jim

RoadMaster
04-17-2006, 09:43 AM
remaking and refactoring are very common traits of any software. You'll tend to recode many spots to make them more malleable or more efficient or just work better as you code.

In terms of actual practices, some people use UML and "requirements engineering" to plan projects out. I've done a bit of this in university, but I tend to find that just putting your ideas down and planning on paper can be quite effective, without the hassle of a special formatting etc. Albiet, you may want to study up on what are known as design patterns, as that's a concept which should help you dissect your program's components better.

Coyote
04-17-2006, 09:59 AM
Look up "Refactoring." And maybe "Object Oriented Design."

Especially when you are first starting out, it can be hard taking everything into consideration and predict everything you are going to need. I don't know if there's anything magic you can do to find those problem areas - it's hard to know until you have been down that road once or twice.

If you take some of the principles of Object Oriented Design (describe your system, and then evaluate all the nouns as potential objects / systems, and then compile that into a list or design), and then just plan on going back and refactoring as you discover more tasks you didn't anticipate, you should be in good shape.

ggambett
04-17-2006, 10:57 AM
I think processes and docs are useful for higher level design decisions than "I need a do-while loop here". A design doc helps you understand what you want to build, and the overview of how will you build it, but having docs so detailed you can anticipate the language constructs you'll use is a waste of time, IMO.