Next: , Previous: , Up: USAGE TIPS and SUGGESTIONS   [Contents][Index]


13.2 Programming tips and other suggestions

  1. Learn how to use the GNU info browser to access the on-line documentation.
  2. Read the list of new features and changes for the last several releases. See NEW FEATURES.
  3. Periodically check ftp.pppl.gov:/pub/fweb/READ_ME for bug reports and other news. Make bug reports! See SUPPORT.
  4. If you have a color terminal, try the option ‘-C1’ (see -C’: Set the color mode, see Color output).
  5. Any option in .fweb that is intended to be processed after the command-line options should begin with ‘&’ rather than ‘-’. (This is rarely necessary.) See Initialization
  6. Put standard command-line options into .fweb. Also put there standard style parameters—e.g.,
    -pindex.tex "#.ndx"
    -pmodules.tex "#.mds"
    -pcontents.tex "#.cts"
    
  7. Learn how to use the style file. See The Style file.
  8. Use the info options ‘-@’, ‘-D’, ‘-y’, and ‘-Z’ to find out about various internal FWEB tables (control codes, reserved words, memory allocations, and style-file parameters). See Information options.
  9. Begin all FWEB sources with invisible commentary bracketed by ‘@z...@x’. See @z’: Begin ignorable material, or terminate change.
  10. Always include an explicit language-setting command in the limbo section. Under normal circumstances, do not set the language from the command line. See LANGUAGES.
  11. Keep sections quite short. Knuth suggests a dozen lines. That’s quite hard to achieve sometimes, but almost never should a section be more than a page long. If a block of code is longer than that, split it up using named modules.
  12. It’s easy to define macros from the command line to expedite conditional preprocessing. See -m’: Define FWEB macro (FTANGLE).
  13. Use the preprocessor construction ‘@#if 0...@#endif’ to comment out unwanted code. See Preprocessing.
  14. For logical operations with the preprocessor, use ‘||’, not ‘|’.
  15. It’s conventional to identify the ends of long preprocessor constructions as follows:
    @#if A
    .
    .
    @#endif // |A|
    
  16. To debug an errant FWEB macro, use the built-in function ‘$DUMPDEF’. See $DUMPDEF: Dump macro definitions to the terminal.
  17. Use ‘@?’ for compiler directives. See @?’: Begin compiler directive. Use the style-file parameters ‘cdir_start’ to specify information that will be written out at the beginning of the line. See cdir_start.
  18. Stick to the standard FWEB commenting style ‘/*...*/’ or ‘//...’. Don’t use alternatives such as FORTRAN’s column 1 convention; these may not work or may not be supported someday. See COMMENTING STYLES.
  19. The meta-comment feature ‘@(...@)’ provides a poor-person’s alignment feature. But it doesn’t work very well, and it’s not in the spirit of TeX; learn to use ‘\halign’ or the LaTeX alternatives.
  20. In FORTRAN, use ‘#:0’ to declare readable alphabetic statement labels. See Special tokens and -:’: Set starting automatic statement number.
  21. When mixing languages, define the language of a module at the highest possible level—e.g., in the unamed module, not after ‘@<...@>=’.
  22. Use LaTeX. Plain TeX is no longer supported. Upgrade to LaTeX2e. See LaTeX support.
  23. If you are reading this documentation from printed pages, make sure it’s also installed as an Info package on your system so it can be read interactively with emacs. You can also read it through a World-Wide Web browser such as Netscape. For the address, see SUPPORT.

Next: Features for scientific programming, Previous: Converting an existing code to FWEB, Up: USAGE TIPS and SUGGESTIONS   [Contents][Index]