standards: Reading Non-Free Code

1 
1 2.1 Referring to Proprietary Programs
1 =====================================
1 
1 Don't in any circumstances refer to Unix source code for or during your
1 work on GNU! (Or to any other proprietary programs.)
1 
1    If you have a vague recollection of the internals of a Unix program,
1 this does not absolutely mean you can't write an imitation of it, but do
1 try to organize the imitation internally along different lines, because
1 this is likely to make the details of the Unix version irrelevant and
1 dissimilar to your results.
1 
1    For example, Unix utilities were generally optimized to minimize
1 memory use; if you go for speed instead, your program will be very
1 different.  You could keep the entire input file in memory and scan it
1 there instead of using stdio.  Use a smarter algorithm discovered more
1 recently than the Unix program.  Eliminate use of temporary files.  Do
1 it in one pass instead of two (we did this in the assembler).
1 
1    Or, on the contrary, emphasize simplicity instead of speed.  For some
1 applications, the speed of today's computers makes simpler algorithms
1 adequate.
1 
1    Or go for generality.  For example, Unix programs often have static
1 tables or fixed-size strings, which make for arbitrary limits; use
1 dynamic allocation instead.  Make sure your program handles NULs and
1 other funny characters in the input files.  Add a programming language
1 for extensibility and write part of the program in that language.
1 
1    Or turn some parts of the program into independently usable
1 libraries.  Or use a simple garbage collector instead of tracking
1 precisely when to free memory, or use a new GNU facility such as
1 obstacks.
1