some advice about building more complex programs
Ok i have a question not about code but about how you break down a complex program(well complex to me so far) to make sure you get everything without missing something and having to restart.
I'm making a program now but its getting to be overwhelming as in it has a few combo boxes and textfields and i am having trouble keeping track of all. the reason is and here is an example...if combobox1 gets selection #1 and combobox2 gets this selection do this unless combo box 4 and 5 have this selection or this textfield is enabled etc
how do i break complex stuff like this down to make it a bit more manageable so im less likely to miss some or a bunch of stuff?
Re: some advice about building more complex programs
I have never been to school for programming or anything, so perhaps dont read what I have to say, or keep in mind this is my way to go at a project:
STEP 1: A DETAILED DESCRIPTION OF THE PROBLEM TO BE SOLVED VIA CODE.
Think about the problem. Perhaps a list of the different data sets you will maintain/process, and a list of the processes you are to perform.
STEP 2: A DETAILED DESCRIPTION OF THE PROBLEM TO BE SOLVED VIA CODE.
STEP 2 A: sample data type
sample data type
sample data type
STEP 2 B: sample action
sample action
sample action
These actions are to be performed on the data itself. Not necessarily actions to solve the problem; For example if your project was to sort people of a company, you might have classes like: Employee; Customer; Supplier; SisterCompany;
Data related to those may include: Name; Age; Wages; ID#; ETC;
Actions related to the data may include getters/setters for each data type. Perhaps a method to calculate money over time, or what ever....
Note that so far we have not attempted to solve the problem at hand. We have merely organized our thoughts on what we are working with. This is where you make sure nothing has been left out.
STEP 3: A DETAILED DESCRIPTION OF THE PROBLEM TO BE SOLVED VIA CODE.
STEP 3 A: Take your list from step 2, and start organizing classes between the data and the methods.
Note that we ended up with some related classes. For example Employee and Customer are both people. Surely people have some things in common. All people (i hope..) have a name, and an age. Not to mention the ID# is a great key to store the data under. A Person class as a parent class to Employee and Customer may be an idea. Under the same token, Employees will want paid just like Suppliers. They may have some methods in common, but not all Suppliers would be Person. So extending Person to make Supplier would not work, but an interface could be shared among them with methods to get paid.
I hope the samples are not clouding the idea....
STEP 3 B: This is where you begin your algorithm to solve the actual problem.
Just like in step 2, make a list of what needs to be done to what, but in the general sense. Folowing the sample, we want to organize the data in one place so our sister company can share our data. So the idea of setting up this structure has little to do with Mary who answers phones at night. This list is about the steps involved in sharing the data. Maybe a check-out file system. Or what ever seems to fit best... Take this and organize "The Big Picture".
STEP 4: A DETAILED DESCRIPTION OF THE PROBLEM TO BE SOLVED VIA CODE.
STEP 4 A: Double check what you have so far
Go over everything again and make sure you didnt leave anything out. Make sure your overall plan still fits around what you have so far.
STEP 4 B: Pseudo code
Now its time to start forming pseudo code from your rough outline. You may (and I usually do) find a better plan during this part. Not to worry, its very easy to redo at this point. Fix up what ever changes you see and continue. Once you have the pseudo code for each class and for the overall project structure, its simply a matter of turning it into real code. Your code will be as good as your outline. Get it right from the start, and spend less time dealing with the code.
Getting the outline is far more important on big projects than any amount of code.
I feel like I have been rambling on... Hope that helps.
Re: some advice about building more complex programs
that helped a lot! :D i need very much to make an outline cause im getting too confused remembering all that i have done and need to do...and i dont care if its the proper way just as long as it works :D so thanks a lot for writing that up i appreciate it very much