Mark Hobley 
ALTERNATIVE WAYS OF SUPPORTING DIFFERENT GENERATIONS OF COMPUTER

There are several methods to producing code suitable for different generations of computer:

Method A: Using generic code

This is the preferred method of coding.

/* This code runs on all generations of computer */
genericcode

Pros

Cons

Method B: Using conditional branches

if machinetype=A then
do this
else
do that
endif

Pros

Cons

Method C: Using conditional compilation

#IF MACHINETYPEA
do this
#ENDIF
#IF MACHINETYPEB
do that
#ENDIF

Pros

Cons



© Copyright 2008 Mark Hobley