On Wed, Jan 20, 2010 at 10:24, Daniel Dilts <[email protected]> wrote:
> I've started playing around with C and I'm wondering if anybody can tell me
> how to improve my code.  This function just iterates over a directory.  It
> is a really simple function, but the error handling takes up so much space
> that it is difficult to follow the flow of the code.
> Does anybody have any suggestions of how to improve this so that it handles
> all of the possible error conditions and be more readable?  I was thinking I
> could at least use some preprocessor macros to hide much of the if(){...}
> blocks behind them.

Macros are useful, but don't always play nice with gdb (if you end up
needing to debug).  Sub-routines and comments are difficult to
over-use.

-- 
Alex Esplin
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to