Sign in to follow this  
bentaberry

How to plan a computer program?

Recommended Posts

Hi guys, I am getting on well with learning C++ but as I get further into it my programs are becoming more complex and harder to organise as I go along. Is there a method to designing a computer program before actually coding it? Are there applications that can use to break down my idea to make the coding more organised? Is there specific methods and techniques I should be reading up on? I hope that makes sense. Kind Regards David

Share this post


Link to post
Share on other sites
Quote:
Is there a method to designing a computer program before actually coding it?

There are several methods (such as flow-charting) to design programs. However, because life is cruel, you probably won't know enough about program design to use a general method until you've written quite a few programs. There are also engines of various sorts (games engines, database engines, etc.) that are essentially applications to which you add your custom objects, etc.

Another tool to simplify things is/are reuseable classes. I have classes around such as a DirectX application class, a class to load meshes of various sorts, a SoundManager class, etc., which I just add to my current project and integrate fairly easily. A reuseable class such as that is essentially a cpp/header file pair I copy and paste into my project directory. As you program more and more, you'll eventually build up an inventory of classes/files that you like to reuse.

You can look for class code around the web, or write one yourself.

Share this post


Link to post
Share on other sites
Thanks buckeye,

I think my explanation wasnt very clear, but its more down the lines of flow charting that I am looking to use to plan my projects.

Is there any good software to do this?

Should I be looking at http://en.wikipedia.org/wiki/Unified_Modeling_Language?

Kind Regards
David

Share this post


Link to post
Share on other sites
Quote:
I think my explanation wasnt very clear

Actually, your question was better than my answer. I didn't think clearly about:
Quote:

Are there applications that can use to break down my idea to make the coding more organised?

With regard to organizing (and even checking for errors), yes, there are. Unfortunately, I can't directly recommend one, and I think that's what you're looking for.

However, if you mean software for general program design in which you enter into a process box "Open the Database" and it somehow breaks down the steps in more detail without your help - I don't know of any.

I've only used flowcharting software myself (there must be other approaches). The software I used (proprietary for one of the companies I used to work for), we entered structures, relationships and methods; "hooked them together" and it would check for relationship errors, etc. It did not expand anything automatically unless that expansion was already designed. It was pretty much a process document which could be accessed by each developer. Googling for "flowchart software," it appears there are quite a few applications that support that general approach.

Don't know if that helps.

Share this post


Link to post
Share on other sites
To give you another keyword to enter into your search, UML is a typical and well-used but loose "language" for designing software projects as far as basic control flow and function goes. It is like an abstraction layer above what is commonly thought of as flow charting.

I remember working with some software that supported UML diagram creation in university, but haven't really done anything with that recently.

That said, one of the most powerful ways of project flow brainstorming is sticky notes, a whiteboard, and a large surface area. This won't get your project documented, but it helps.

*edit: I see in your followup you encountered the term! Whoopse. Take this as affirmation that you're on the right track then.

Share this post


Link to post
Share on other sites
Long time ago, but on school we had several UML tools for making diagrams, charts and even generating a codebase for you (empty Java classes). However, I never really used it either. It's nice to make a diagram for a Cola vendo or stopwatch, but I wouldn't even think about howto model something like a game, webservice or complex machine controls. Probably making that diagram takes me more time than actually programming it :) I remember on school it was stuff like this that always gave excuses for endless discussions and coffee sessions, instead of doing something. But that is maybe something personal.


Maybe people disagree, but I'd say experience and repeating is worth a lot more. When you write module X for the first time, it's likely you get stuck with bad design decisions, messy coding or wrong chosen classes. But that's ok! Learn of it, and do it again. After doing it 3,4 or 10 times you can dream it. And don't forget to look at other packages. You will learn alot when looking into demo's, books or professional packages such as AutoCAD, game engines or even Windows. The more you'll see, the better you design your next project, even it's a totally new thing.


Not saying UML is a bad thing though. Maybe you understand what's going on in your project, but how to explain others? Billions of ways to visualize modules or routines on paper, and UML is not a bad choice here. It also helps kick-starting a project. Lot's of ideas, put it on paper, organize, then name it and shape it with tools like these.

Greetings,
Rick

Share this post


Link to post
Share on other sites
There are lots of methods used to break down a large project into smaller more managable tasks.

Try googling 'functional decomposition', 'case' (computer aided software engineering), 'software engineering' and 'structured analysis' for a start.

You could also try getting hold of a book called 'Software Engineering'. It's pretty expensive as far as I recall, so try borrowing a copy from a library. Try to get one of the later revised editions if possible.

Most of these methods were developed for commercial programming practice, but are still relevent for games.

If you want to look into UML, try getting a community edition of 'Visual Paradigm'. There is a lot to learn in order to use it effectively though.

Share this post


Link to post
Share on other sites
yo,

the way in which I started with my text programs is to write down on paper, i dont use flow charts coz it gets to much and i try not to get to technical at the start.

Break down what u want to happen with the code and write it on paper. the way u plan an essay or script.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this