Board Logo
« BEFORE YOU BEGIN (A Plan for Success!) »

Welcome Guest. Please Login or Register.
Mar 22nd, 2018, 8:08pm

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

This board is not meant for general discussion, it is meant for posting articles to help others.
For general discussions use the appropriate board, which best describes your problem area.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: BEFORE YOU BEGIN (A Plan for Success!)  (Read 10063 times)

member is offline


Never let your beliefs get in the way of learning.


Gender: Male
Posts: 4407
xx BEFORE YOU BEGIN (A Plan for Success!)
« Thread started on: Apr 10th, 2005, 4:20pm »

(Plan for Success!)

Neither Ford or General Motors would begin production of a new model car without a design concept, perhaps even a prototype of the new model. A contractor who begins construction without plans and materials is on his way to many failures and finally bankruptcy. An electronics engineer (or even a hobbyist) would not install a newly created component without first testing the device to see if it works properly.

Enthusiastic coders at all levels of experience have a tendancy to jump in with both feet in their rush to quickly arrive with a completed program. A good coder learns to avoid this, even if he/she wants only to write a simple program. Obviously we write programs to accomplish a task; sometimes the tasks are quite sophisticated.

There was a day when programmers began with a “flow-chart” as an outline to developing their program. Today, many programmers prefer “pseudo-code,” which is simply a written guide outlining the tasks to be accomplished by the program. Being an old military man (no offense to he/she who may not be), I tend to think of my outline as a “mission statement,” with one or more minor tasks to be accomplished, all leading to the completion of my program. No matter what your goal, you should first come up with a plan.

The first item of my outline must be TASK, or some other name useful to you. Your outline can be stated in generalizations, or you may want to go into details and include methods to be applied and variable names for use within each sub-task. Don’t make the mistake of getting bogged down with details before you begin. Generally, you need to decide “What is it I want this program to do?” How the details will be accomplished will become apparent as you organize your task. Let’s use a simple data program for illustration.

TASK: Collect, process, and display data.
1. Will data be entered using READ statements; from keyboard; from file?
2. How will the data be organized? How many records? How many fields? In what order?
3. Will it be necessary to sort the data?
4. Will a GUI be appropriate or useful?
5. What will be the output? (Graphic? List? File?)
6. After you have outlined a plan, you can begin coding.
7. Test and debug. (Except “Hello world!” no program ever runs properly the first time. Sometimes, not even “Hello world!”)
8. Create distributable program if needed.

Sub-Task 1: Data which remains constant is often loaded from data statements in the program using a loop. Go into your toolbox and decide upon the type of loop you will use. If data will be entered from the keyboard (likely for minor changes), write an input routine for the user. If using a file for data, create a data file to be distributed.

Sub-Task 2: Will the data be numeric or alpha-numeric (string$)? Will the data require an array, or can it be processed directly?

Sub-Task 3: Small data lists may not require sorting. For larger lists, sorting may lead to faster program execution. Will you write your own sort routine? Is a native SORT function appropriate?

Sub-Task 4: A gooey can make your program more user friendly and can reduce user errors if buttons or checkboxes are ticked to branch to appropriate routines in the code.

Sub-Task 5: Graphs for output can display several types of data at one glance. Ordered lists are useful if searching for a particular item or name. Output files are useful if the data needs to be reviewed after an application has been closed. Often, the hardcopy of an output file makes it easier to compare data which has changed since the last program run.

Sub-Task 6: Knowing where you are now and where you want to be when the program is completed, examine your “toolbox” for methods to accomplish the sub-tasks in your program. Do I need to print to a file? Do I need to open a file for input? Do I need a loop here or there? What about images or a TIMER function? If the user is going to input information from the keyboard, it’s likely I will have to check for input errors.

Sub-Task 7: Run the program. You may test and debug the program when intermediate blocks have been added, which will aid in isolating programming errors. Does your program properly create and load arrays? Are there any surprises in computed values? Did the darned thing crash and burn after you added that last block? Why? Developing your code in small steps may seem tedious, but it is usually the fastest way to a successful conclusion.

Sub-Task 8: Create a distributable version. Unless your application is solely for your pleasure, you will want to share it with others. If your user has basic installed, sending only the .BAS program and supporting files will be all which is needed. If your user needs the files required to run a basic program, you will have to create a token file and run-time engine with all the .SLL and .DLL files included.

A carpenter would not stop building a house each time he needed a different tool. He would have them all on the job site before beginning. By deciding early what tasks must be accomplished on the way to completion, you can collect information or files needed from the start and not have to interrupt working on the program to assemble other tools.

Your task outline does not always need to be written or printed, especially if the objective is relatively simple. When you develop good habits, your code will become “mentally organized” before you begin, allowing simple programs to be quickly completed. If your objective is quite complicated, having a written outline will assist you in the step-by-step completion of your program. If the application requires many days or weeks while the intermediate steps are completed, the outline will keep you oriented and on track.

Coding is fun, and the completion of a program is always satisfying. By having a plan to build your program, you can avoid many failures and ruined projects. Learn how to organize your work so you can have FUN!

User IP Logged

JB 1.01
Win7 64bit, 4 GB RAM, Pentium 6200@2.13 GHz (laptop)
WinXP, 1 GB RAM, Intel N270@1.6 GHz (netbook)
Junior Member

member is offline



Posts: 101
xx Re: BEFORE YOU BEGIN (A Plan for Success!)
« Reply #1 on: Nov 9th, 2009, 08:06am »

Wow!! There's a lot there! Thanks for posting Welopez!
User IP Logged

Senior Member

member is offline



Posts: 1740
xx Re: BEFORE YOU BEGIN (A Plan for Success!)
« Reply #2 on: Nov 9th, 2009, 9:38pm »

Subtasks 1 and 2 can and should include a data variable table. This is a list and explanation of every variable planned to be used in the program categorized by their usage among the purposes of Input, Processing, and Output.

Even our event-based programs created in Just BASIC often contain some procedural components. These procedures are sometimes complex enough that we benefit from creating flowcharts of the procedures. One great thing about these flowchart is that they can be translated directly into BASIC code. (The good old BASIC textbooks from long ago showed how this was used).
User IP Logged

New Member

member is offline



Posts: 6
xx Re: BEFORE YOU BEGIN (A Plan for Success!)
« Reply #3 on: Nov 8th, 2011, 12:26am »

Thanks to share your deep knowledge with us it will to all who will read it from the starting to the end in every point there is a something new.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls