Harishvk27′s Weblog

December 17, 2010

coding guidlines

Filed under: C++ — harishvk27 @ 5:45 am

)1) while coding it;s better to maintain single return statement when method/function handles critical sections and uses locks or other synchronization mechanism

(2) in case of C++, use ++ instead of ++. ++ is more efficient when compared to ++ because post increment will result in copy constructor getting called while pre-increment will not.

(3) it’s always better to initialize the member variables of class as part of class construction using member variable constructors.

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.