coding style

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Johnson

    coding style

    is this C style coding?

    I don't seem to see much C++ code in this way.

    is this a bad programming practice?

    code seem ugly coding this way.


    =============== ==
    CATCHERROR(m_Cn n,0)

    =============== ==
    #define CATCHERROR(ptr, a) catch(_com_erro r &e)\
    {\
    ErrorHandler(e, m_ErrStr);\
    ptr=NULL;\
    return a;\
    }

  • Ivan Vecerina

    #2
    Re: coding style

    "Jim Johnson" <aopiyy001@yaho o.comwrote in message
    news:mbldv3lj8e tvnsoobt5ou780g q2otn4itn@4ax.c om...
    : is this C style coding?
    :
    : I don't seem to see much C++ code in this way.
    :
    : is this a bad programming practice?

    This is not C, but poor C++ code, relying on the preprocessor
    supposedly to avoid repeating code. This is considered as
    bad style and poorly maintainable; better alternatives
    usually exist. However, for lack of context, it is not
    possible to give you a specific recommendation.

    : code seem ugly coding this way.
    :
    :
    : =============== ==
    : CATCHERROR(m_Cn n,0)
    :
    : =============== ==
    : #define CATCHERROR(ptr, a) catch(_com_erro r &e)\
    : {\
    : ErrorHandler(e, m_ErrStr);\
    : ptr=NULL;\
    : return a;\
    : }


    --
    http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
    Brainbench MVP for C++ <http://www.brainbench.com

    Comment

    Working...