Often times the process of writing programs can be intense with requirements to follow, technical problems to solve, users to communicate with and deadlines to meet. Many pitfalls await the undisciplined developer including:
- the loss of source code
- files missing from source code control
- unrecorded changes in user requirements
- lost passwords
- discovering that your latest additions have broken one or more existing features in your application
- out dated documentation or help files
- or time wasted attempting to find a solution to a technical issue that another programmer within your organization has already solved
Yet these pitfalls can be overcome by following a few simple practices:
1. Keep a log of your work, in a notebook or in an electronic form that includes
- The task that you are currently working on
- Problems encountered
- Files added or modified
- Points discussed with your clients
- Questions to be resolved
- Bugs to fix
- Dates of task completion
By maintaining a log of the details of program development one no longer needs to relay on memory alone. On one occasion it was necessary to for me modify nine different files spread over several different directories to make a change to an accounting program. Because I kept a record of each of the files I modified, I had no problem moving the modified files from my development site to production site. Without this log, I would have been missing some of the files. The simple practice of keeping a log will eliminate errors due to programmer memory lapses. It will also provide a useful account of the development process for your application such questions arise later on.
2. Make better use of source code management tools. There have been occasions where I have worked all day adding features to a web application only to find that once all the features have been added a bug had also been introduced into the program. Now if I made incremental backups or submitted my code to source code control each time I added a new feature, then it would have been easy for me to roll back my changes and locate the which modification caused the bug. It is a simple practice, but it can save lots of time in locating and fixing problems.
3. Validate your code. When we see our web applications running on the internet it is easy to think that they are free of validation errors, but that is not true at all. There could be errors concealed in your JavaScript, cascading style sheets or html output that your browser is not telling you about. But by using a validator you can find these errors that could come back to surprise you after your applications goes live on the net.
About.com lists a number of useful validators:
And for validating javascript: JSLint
4. Create and maintain a knowledge base of solutions, useful code, web links and helpful information for future reference. I have learned over the years to collect and save solutions that I have found to programming problems or links to useful web sites. Why should I search the source code archives or the web for a function I used in a WordPress theme last year when I can locate it instantly in my knowledgebase. Or even better idea; create a companywide knowledge base so that developers can share their knowledge. With such a knowledge base a programmer will not have to try to find a solution to a problem that one of his co-workers had already solved six months earlier.
These are the four practices that I have found useful for making my application development more productive. What are yours?