[comp.lang.c++] >>>> C++ versus C

ssimmons@convex.com (Steve Simmons) (10/17/90)

	For good software engineering practice of data abstraction,
	data modeling, and proper interface definition,  C++ most 
	definitely out does C in almost every way. However, there 
	are the following things that must be considered before starting
	the project...

	1.  It is faster to code in C than in C++ in the short term.
	The langauge does not require as much bookkeeping and there 
	are fewer language mechanisms to be confused by.  Programmers
	do not have to be as knowledgeable in data abstraction to 
	crank out a great deal of code fast.

	2. In the long term,  C++ code is easier to maintain if you 
	follow the practice of starting with a few build blocks 
	and building on top of them.  That is, spend a great deal 
	of time building your data abstractions up front first. 
	Share as much code as possible.  A good starting place 
	is the NIH library.  It contains many of the basic data 
	abstractions of STRINGS, LINKED LISTS, REGULAR EXPRESSIONS,
	BIT VECTORS, etc..  Learn from them how to build a hierarchy
	of objects.  It is not flawless but it does provide an 
	excellent example.  


	3. Define a set of common programming practices so that 
	the code may be reused as easily as possible.  Certainly,
	coding conventions could help but there are many more basic
	things.  That is, you should encourage the following...

		- placing tags in the class instantiations so that
		runtime assertions can be made on virtual calls.

		- keep one class per file combination (header and body)
		Use the header to defined the interface and use the 
		.C to contain the hidden interface.

	There are many others.  I hope other people in the newsgroup
	can contribute so more.  

	Thank you.

						Steve Simmons