Article # 294, added by Geoworks, historical record
| first | previous | index | next | last |

So what is the the theory behind EC code?



Q. So what is the the theory behind EC code?  How much is good,
   and how much is too much?

A. Put in as much EC code as possible.  It is great for catching bugs
   now and in the future (when some other poor soul is maintaining the
   code).  A good basic rule is to check all parameters coming into a 
   function and all values returned from a function call. Also checking
   global variables before passing them to a function is a good idea.

   The non-EC version of EC routines are just stubs that immediately
   return, so EC code will have minimal impact on your application's
   performance.  Additionally, you can encapsulate EC routines in the
   EC() macro, which will prevent even the stub from being called when
   you compile for non-EC.