coding style

Discussion in 'C++' started by Jim Johnson, Apr 5, 2008.

  1. Jim Johnson

    Jim Johnson Guest

    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_Cnn,0)

    =================
    #define CATCHERROR(ptr,a) catch(_com_error &e)\
    {\
    ErrorHandler(e,m_ErrStr);\
    ptr=NULL;\
    return a;\
    }
    Jim Johnson, Apr 5, 2008
    #1
    1. Advertising

  2. "Jim Johnson" <> wrote in message
    news:...
    : 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_Cnn,0)
    :
    : =================
    : #define CATCHERROR(ptr,a) catch(_com_error &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
    Ivan Vecerina, Apr 5, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Baxter

    style for coding latches

    Paul Baxter, Aug 10, 2003, in forum: VHDL
    Replies:
    7
    Views:
    1,128
    Mike Treseler
    Aug 15, 2003
  2. Willem Oosthuizen

    Coding style to prioritize certain inputs

    Willem Oosthuizen, Sep 2, 2003, in forum: VHDL
    Replies:
    5
    Views:
    495
    Mike Treseler
    Sep 4, 2003
  3. Analog Guy

    Coding style for CPLD vs FPGA

    Analog Guy, Mar 11, 2005, in forum: VHDL
    Replies:
    3
    Views:
    5,436
    Klaus Falser
    Mar 14, 2005
  4. calmar
    Replies:
    11
    Views:
    776
    calmar
    Feb 21, 2006
  5. Ken Varn
    Replies:
    0
    Views:
    439
    Ken Varn
    Apr 26, 2004
Loading...

Share This Page