[Discuss] OT Rant/Discussion C vs C++

Mark Woodward markw at mohawksoft.com
Sat Dec 15 16:03:50 EST 2012


I started programming back in the 1970s. When I learned C, C was a new 
language. ANSI C was a big thing and we had to "port" to ANSI C because 
various vendors implemented vagueness in the C syntax differently. Those 
of us who understood portability between C compilers fared better. 
Anyway, when C++ came along, it was a similar sort of deal. The rough 
edges around the language were different across different vendors. 
Templates especially. Understanding this always made maintaining the 
code, over time, easier.

As C++ developed, those of us who were conservative in our 
implementations fared well in the Borland/Microsoft C++ war.  In 
adopting C++, the general rule was to use the "safe" constructs of the 
language and use only those aspects of the language that facilitated the 
architecture and leave the rest alone. Even today, aspects of C++ create 
immense bloat in code. (Templates)

Maybe old habits are hard to break, I don't know, but I still consider 
the old way a good design philosophy. The whole "[OT] C++ strings" 
discussion is a perfect example. A C++ programmer and/or architect 
should resist the temptation to be "language lawyers" and design 
software that requires understanding the arcana of the language to 
understanding the body of the code. It may be clever, but it makes the 
code hard to understand and of reduced value in the future.



More information about the Discuss mailing list