|
The following is my general guidelines I use in designing and developing applications.
- Limit the number of constraints of the project. The smaller the number constraints, the easier it is to add functionality and evolve the program. The constraints that are originally built into the program are never the same as the constraints in the finished product.
- Design before you start to code. A well thoughtout plan of attack will allow you to minimize constraints, identify common functions, and give the program some structure even before the data storage is defined and the first functions are written
- Never have the same code in two places. If the code does the same thing, standardize it and create a function. So when it is time to add an enhancement, the code only has to be changed once and the effect is felt throughout the program.
- Make sure that you can easily add new functionality at a later date. No project (especially on the web) is really complete and everything needs maintenance and enhancements so plan on them.
- Never take a short cut expecting the code will suffice.
- Keep things simple. Nothing is more frustrating (or embarrassing) than not being able to understand code that you wrote 6 months ago due to its complexity.
- Use a common naming convention and descriptive variable names as it allows the program to maintain a consistant feel to it.
Now to give some examples on how I use these principles in my programming.
In all my programs, I have my database connections located in one module and reference that module throughout the rest of the program. It is not very complicated. It just opens and closes the database and recordset objects and returns the object pointers back to the calling function. It has a few other functions that handle specific tasks like executing a sql statement and executing a sql statement and returning the Idenity but overall its only task is to run the open and close commands. There are numerous benefits to this as it allows me to only have one connection open at a time through connection counting and I can make database changes easily by editing the connection string and recompiling the project. But the key is that it completely isolates all my database connections to one spot in the source. If I need to debug something, I can completely avoid that module if any open/close works. It also allows me to make a database component change and know that if it works in one location, it will work everywhere.
Every time I am given an assignment to write something, whether a system or just a small tool, I always define the data storage before I begin coding. In defining the data storage, you can begin to see objects falling into place. Need to collect personal information; then you will need a person table and a person object to handle the data. As you keep going, more objects will fall out
|
| Testimonals |  | |
| I can't envision an easier program to use to record trades. |
|
| Products |  | More ... |
|
| Articles |  | All |
|
|