[an error occurred while processing this directive]
FTOOLS
Home
Next: A Few Specifics
Up: Dos and Don'ts of
Previous: Dos and Don'ts of
Before getting to specifics, there are a few general guidelines to keep in mind when writing FTOOLS. First of all, an FTOOLS package must be portable. What is a portable package? One that will compile and run on various platforms without user modification to the source code. If a user must edit a file that ends in c, f, h, or inc, the package isn't portable. This sounds obvious, but it's an easy goal to loose sight of. Portability is achieved through careful design of the source code itself and careful design of the build process.
Considering the source code itself, the programmer must remember that their code isn't meant for them - it's meant for a wide audience of people on various platforms at various places at various points in the future. If for some reason you don't want anyone else reading (understanding) your code, stop here. You want to distribute binaries and not source code. Everything about portable code doesn't apply because it will be your headache, not mine. With that in mind, your code needs to be straight forward and riddled with comments. Give a random page of what you've written to another programmer at your level. If they can't get a rough idea of what's happening with that chunk in 15 minutes, you've got a problem. Two years from now when you're trying to figure out why a section is segment faulting on a machine that doesn't exist today, you'll appreciate readable code.
Here are a few other points to keep in mind:
With the build procedure, the same general ideas presented for the source guidelines also apply. The goal is a process that's efficient, straight forward, and easy to translate to other architectures. In the build process you'll want to make all the necessary adjustments for the target platform/environment. This can of course be complicated at times, but it doesn't need to be oblique.
Points to consider when designing how your package compiles:
Before going on to more specific points, let me leave you with the Golden Rules for FTOOLS Programming: