next up previous
Next: Comments Up: Prevention Previous: Code reuse

Avoid automatic types

While strict languages, such as C, C++, Java, etc. only allow explicit type declaration of variables, several languages allow for implicit or automatic types. Fortran, for example, has the capability to automatically create variables of various types (integers, floats, doubles, etc) depending on the first letter of the variable. This is problematic as it can cause ambiguity in your programs and decrease the readablility. For Fortran, by declaring ``IMPLICIT NONE'' at the beginning of a function or program, you indicate that all variables should be explicitly typed and declared. While this may be a little more work (to add just 1-3 lines of code), the time you save by avoiding accidental variables, or type-mismatches will be well worth it.



Spencer Eugene Olson 2005-01-19