coding style

J

Jim Johnson

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;\
}
 
I

Ivan Vecerina

: 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;\
: }
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top