{"id":916,"date":"2024-08-09T20:17:44","date_gmt":"2024-08-09T20:17:44","guid":{"rendered":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/?page_id=916"},"modified":"2025-01-25T20:59:58","modified_gmt":"2025-01-25T20:59:58","slug":"c-overview","status":"publish","type":"page","link":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/topics\/c-details\/beginnings\/c-overview\/","title":{"rendered":"An Overview of C++"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Goals_of_C\"><\/span>Goals of C++<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-medium-font-size\">To make programming in C more pleasant, more productive, and less error-prone.<\/li>\n\n\n\n<li class=\"has-medium-font-size\">To be as upward compatible with ANSI C as possible (but no more so).<\/li>\n\n\n\n<li class=\"has-medium-font-size\">To support data abstraction, information hiding, and encapsulation.<\/li>\n\n\n\n<li class=\"has-medium-font-size\">To support object-oriented programming.<\/li>\n\n\n\n<li class=\"has-medium-font-size\">To provide performance comparable to C.<\/li>\n\n\n\n<li class=\"has-medium-font-size\">To be widely available, and widely accepted.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Evolution_of_C\"><\/span>Evolution of C++<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-medium-font-size\">Developed by Bjarne Stroustrup at AT&amp;T Bell Labs in the early 1980s.&nbsp;&nbsp;<\/li>\n\n\n\n<li class=\"has-medium-font-size\">An ANSI\/ISO committee is working on C++ standardization.<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Influences:&nbsp; C, Simula 67, Algol 68<\/li>\n\n\n\n<li class=\"has-medium-font-size\">First version in 1980: \u201cC with Classes\u201d\n<ul class=\"wp-block-list\">\n<li><em>Classes: An Abstract Data Type Facility for the C Language<\/em>, ACM SIGPLAN Notices, 1982<\/li>\n\n\n\n<li><em>Adding Classes to C: An Exercise in Language Evolution<\/em>, Software &#8212; Practice and Experience, 1983<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Renamed C++ in 1983\/84<\/li>\n\n\n\n<li class=\"has-medium-font-size\">Educational Release in 1983<\/li>\n\n\n\n<li class=\"has-medium-font-size\">General Releases 1985, 1986, 1987, 1988, 1989, 1990, &#8230;<\/li>\n\n\n\n<li class=\"has-medium-font-size\">ANSI\/ISO C++ Standard finalized in 1998.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"C_Resources\"><\/span>C++ Resources<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>The C++ Programming Language<\/em>, (First Edition) Bjarne Stroustrup, Addison-Wesley, 1986 (was the &#8216;C++ Bible&#8217;, but is now <strong><em>completely<\/em><\/strong> out of date)<\/li>\n\n\n\n<li>USENIX C++ Workshops in Sante Fe, New Mexico (1987) and Denver, Colorado (1988) (Proceedings available from USENIX Association)<\/li>\n\n\n\n<li><em>The Annotated C++ Reference Manual (ARM)<\/em>, Margaret Ellis and Bjarne Stroustrup, Addison-Wesley, 1990&nbsp; (The new &#8216;C++ Bible&#8217; reference, and the base for the ANSI\/ISO C++ standards effort)<\/li>\n\n\n\n<li><em>The C++ Programming Language,<\/em> (Third Edition) Bjarne Stroustrup, Addison-Wesley, 1997. This is really the new &#8216;C++ Bible&#8217;, and is a major rewrite of the Second Edition (which in turn considerably augmented the First Edition).<\/li>\n\n\n\n<li><em>The Design and Evolution of C++<\/em>, Bjarne Stroustrup, Addison-Wesley, 1994.&nbsp;<br>Some interesting insights into why the language is the way it is.<\/li>\n\n\n\n<li>There are now lots of books on C++, some good, some bad, some terrible&#8230;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"C_Penetration\"><\/span>C++ Penetration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Probably the fastest-growing computer language (until Java came along).<\/li>\n\n\n\n<li>Installed on thousands of computers from micro to mainframe, across the entire world.<\/li>\n\n\n\n<li>Use of C++ has burgeoned<br>(Stroustrup estimated at one point that, over a considerable period of time, the number of C++ users was <em>doubling every 4 to 6 months!<\/em>)<\/li>\n\n\n\n<li>Used in wide variety of applications:\n<ul class=\"wp-block-list\">\n<li>C++ compiler, debugger<\/li>\n\n\n\n<li>Financial Trading systems<\/li>\n\n\n\n<li>Switching systems<\/li>\n\n\n\n<li>Simulations<\/li>\n\n\n\n<li>Graphics\/Windows<\/li>\n\n\n\n<li>etc., etc.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"C_Characterization\"><\/span>C++ Characterization<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Roots same as those of C (Bell Labs)\n<ul class=\"wp-block-list\">\n<li>Similar &#8216;pragmatic&#8217; approach (as opposed to &#8216;theoretical&#8217;)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Decidedly a <em>hybrid<\/em> Object-Oriented language<\/li>\n\n\n\n<li>Supports Object-Oriented programming, but does not require it<\/li>\n\n\n\n<li>Does not penalize you (in terms of performance) if you don&#8217;t use a feature.<\/li>\n\n\n\n<li>C++ is a <em>very<\/em> large, complex language (at least as much as Ada).<\/li>\n\n\n\n<li>Some people, especially from the &#8216;pure O-O&#8217; camp, criticize it for its complexity and &#8216;warts&#8217;.\n<ul class=\"wp-block-list\">\n<li>There was a lot of &#8216;C++ bashing&#8217; at the 1990 OOPSLA conference.&nbsp;&nbsp;&nbsp;&nbsp;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Bell Labs was reputed to use C++ as a &#8216;better lint&#8217;<\/li>\n\n\n\n<li>C++ use has been growing by leaps and bounds, although not all its adherents use it for O-O.<\/li>\n\n\n\n<li>At one point, it probably had no significant competition for being the predominant O-O programming language.&nbsp; This has changed with the advent of Java.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"C_Implementations\"><\/span>C++ Implementations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AT&amp;T translator (cfront):\n<ul class=\"wp-block-list\">\n<li>A &#8220;front end&#8221; for a C compiler.<\/li>\n\n\n\n<li>Written by Stroustrup and others at Bell Labs.<\/li>\n\n\n\n<li>Generates C source code, not object code directly (this was key to C++&#8217;s initial wide acceptance and rapid growth)<\/li>\n\n\n\n<li>Written in C++ with a bootstrap version in C<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>True compilers:\n<ul class=\"wp-block-list\">\n<li>Microsoft Visual C++<\/li>\n\n\n\n<li>Borland C++Builder<\/li>\n\n\n\n<li>gcc (GNU C++ from the Free Software Foundation) for a wide variety of platforms.<\/li>\n\n\n\n<li>Sun C++ for Sun &nbsp;&nbsp;<\/li>\n\n\n\n<li>Lots of others, many from hardware vendors (HP, IBM, etc.)&#8230;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Note: The above list needs to be updated&#8230;<\/strong><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"C_Features\"><\/span>C++ Features<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C++ is more than just &#8216;an enhanced C&#8217;<\/li>\n\n\n\n<li>Features can be classified as:\n<ul class=\"wp-block-list\">\n<li>Small Enhancements<\/li>\n\n\n\n<li>Large Enhancements<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Distinctions between &#8216;small&#8217; and &#8216;large&#8217; not always clear-cut.<\/li>\n\n\n\n<li>All of the &#8216;Small Enhancements&#8217; and some of the &#8216;Large Enhancements&#8217;&nbsp; can be used without touching Object-Oriented programming.<\/li>\n\n\n\n<li>To make optimal use of C++, however, it really pays to try to use a different&nbsp; &#8216;O-O mindset&#8217;.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-medium-font-size\"><strong>Small Enhancements<\/strong>\n<ul class=\"wp-block-list\">\n<li>Line-style comments<\/li>\n\n\n\n<li><strong>struct<\/strong>\/<strong>union<\/strong>\/<strong>enum<\/strong> tags become true type names<\/li>\n\n\n\n<li>Declaration placement<\/li>\n\n\n\n<li>Scope operator<\/li>\n\n\n\n<li><strong>const<\/strong> specifier (stricter than ANSI C)<\/li>\n\n\n\n<li>Anonymous <strong>union<\/strong><\/li>\n\n\n\n<li>Explicit (function-like) type conversion<\/li>\n\n\n\n<li>Function prototypes (stricter than ANSI C)<\/li>\n\n\n\n<li>Overloading of function names<\/li>\n\n\n\n<li>Default values for function parameters<\/li>\n\n\n\n<li>Functions with unspecified number of parameters (stricter than ANSI C)<\/li>\n\n\n\n<li>Reference parameters in functions<\/li>\n\n\n\n<li><strong>inline<\/strong> specifier<\/li>\n\n\n\n<li><strong>new<\/strong> and <strong>delete<\/strong> operators&nbsp;<\/li>\n\n\n\n<li>Pointers to void and functions returning <strong>void<\/strong> (stricter than ANSI C)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-medium-font-size\"><strong>Large Enhancements<\/strong>\n<ul class=\"wp-block-list\">\n<li>Stronger typing, with the necessary extensions for object-oriented programming &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/li>\n\n\n\n<li>The <strong>class<\/strong> construct, and class member encapsulation<\/li>\n\n\n\n<li>Constructors and destructors (automatically invoked; guaranteed to be invoked on creation and destruction of an object)<\/li>\n\n\n\n<li>Overloading of operators and functions<\/li>\n\n\n\n<li>References (general use)<\/li>\n\n\n\n<li><strong>friend<\/strong>s of a <strong>class<\/strong><\/li>\n\n\n\n<li>Member class objects<\/li>\n\n\n\n<li><strong>const<\/strong> member functions<\/li>\n\n\n\n<li><strong>static<\/strong> members<\/li>\n\n\n\n<li>Derived classes (including multiple derivation)<\/li>\n\n\n\n<li><strong>virtual<\/strong> functions<\/li>\n\n\n\n<li>Virtual base classes<\/li>\n\n\n\n<li>Exceptions<\/li>\n\n\n\n<li>Templates<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Five_Levels_of_C_Mastery\"><\/span>The Five Levels of C++ Mastery<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It has been said by a large organization using C++ that there are five levels a typical C user may go through when learning C++:\n<ul class=\"wp-block-list\">\n<li><strong>Level 0: <\/strong>can be described as typical C and usually takes <em>days<\/em> to learn.<\/li>\n\n\n\n<li><strong>Level 1: <\/strong>can be described as better C (C++&#8217;s stronger type checking) and usually takes <em>a week or so <\/em>to learn.<\/li>\n\n\n\n<li><strong>Level 2: <\/strong>can be described as advanced C (inlining) and usually takes <em>a month <\/em>to learn.<\/li>\n\n\n\n<li><strong>Level 3: <\/strong>can be described as abstract data type (defining classes) and usually takes <em>up to six months <\/em>to learn.<\/li>\n\n\n\n<li><strong>Level 4: <\/strong>can be described as object-oriented programming paradign (use of inheritance and polymorphism) and usually takes <em>up to a year <\/em>to learn.&nbsp; This is also called an object-oriented design level (OO analysis, OO design and use of an OO database).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>At the end of level 4, C programmers are thinking in the object-oriented paradigm and begin to rethink their programming design methodology.&nbsp;&nbsp;<\/li>\n\n\n\n<li>This stuff takes time!<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Goals of C++ Evolution of C++ C++ Resources C++ Penetration C++ Characterization C++ Implementations Note: The above list needs to be updated&#8230; C++ Features The Five Levels of C++ Mastery<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1871,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-916","page","type-page","status-publish","hentry"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/comments?post=916"}],"version-history":[{"count":4,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/916\/revisions"}],"predecessor-version":[{"id":1674,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/916\/revisions\/1674"}],"up":[{"embeddable":true,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/1871"}],"wp:attachment":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/media?parent=916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}