Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > coding style

Reply
Thread Tools

coding style

 
 
Jim Johnson
Guest
Posts: n/a
 
      04-05-2008
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;\
}

 
Reply With Quote
 
 
 
 
Ivan Vecerina
Guest
Posts: n/a
 
      04-05-2008
"Jim Johnson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
: 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
general coding issues - coding style... calmar Python 11 02-21-2006 10:36 AM
Coding style for CPLD vs FPGA Analog Guy VHDL 3 03-14-2005 08:26 AM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
Coding style to prioritize certain inputs Willem Oosthuizen VHDL 5 09-04-2003 05:17 PM
style for coding latches Paul Baxter VHDL 7 08-15-2003 06:19 PM



Advertisments