{"id":532,"date":"2008-09-25T15:45:16","date_gmt":"2008-09-25T20:45:16","guid":{"rendered":"http:\/\/esr.ibiblio.org\/?p=532"},"modified":"2010-07-19T01:45:43","modified_gmt":"2010-07-19T06:45:43","slug":"c-considered-harmful","status":"publish","type":"post","link":"http:\/\/esr.ibiblio.org\/?p=532","title":{"rendered":"C++ Considered Harmful"},"content":{"rendered":"<p>My blogging will be sporadic to nonexistent for a while, as my friend Rob Landley and I are concentrating heavily on writing a paper together.   The working (and probably final) title is &#8220;Why C++ is Not Our Favorite Programming Language&#8221;.  It begins:<\/p>\n<blockquote><p>\nC++ is an overcomplexity generator.  It was designed to solve what<br \/>\nturned out to be the wrong problems; as a result, it lives in an<br \/>\nunhappy valley between two utility peaks in language-design space,<br \/>\nwith neither the austere elegance of C nor the expressiveness and<br \/>\ncapability of modern interpreted languages. The layers, patches, and<br \/>\nadded features designed to lift it out of that valley have failed to<br \/>\ndo so, resulting in a language that is bloated, obfuscated, unwieldy,<br \/>\nrigid, and brittle.  Programs written in C++ tend to inherit all<br \/>\nthese qualities.<\/p>\n<p>In the remainder of this paper we will develop this charge into<br \/>\na detailed critique of C++ and the style it encourages.  While we<br \/>\ndo not intend to insult the designers of C++, we will not make<br \/>\nexcuses for them either. They repeatedly made design choices that<br \/>\nwere well-intentioned, understandable in context, and wrong.  We<br \/>\nthink it is long past time for the rest of us to stop suffering<br \/>\nfor those mistakes.\n<\/p><\/blockquote>\n<p>Yes, we are attempting to harpoon the Great White Whale of modern programming languages.  I&#8217;m announcing this here to give my commenters the opportunity to contribute.  If you know of a particularly good critical analysis of C++, or technically detailed horror story around it, please cite.  Superb apologetics for the language would also be interesting.<\/p>\n<p>The paper is developing primarily from a software-engineering perspective rather than out of formal language theory. I&#8217;m particularly looking for empirical studies on the importance of manual memory management as a defect attractor (I have the Prechelt paper from the year 2000).  I&#8217;m also interested in any empirical studies comparing the productivity impact of nominative vs. structural vs. duck typing.<\/p>\n<p>After about 3 days of work our draft is over 600 lines of clean narrative text in asciidoc.  It&#8217;s going well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My blogging will be sporadic to nonexistent for a while, as my friend Rob Landley and I are concentrating heavily on writing a paper together. The working (and probably final) title is &#8220;Why C++ is Not Our Favorite Programming Language&#8221;. It begins: C++ is an overcomplexity generator. It was designed to solve what turned out&hellip; <a class=\"more-link\" href=\"http:\/\/esr.ibiblio.org\/?p=532\">Continue reading <span class=\"screen-reader-text\">C++ Considered Harmful<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-software","entry"],"_links":{"self":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=532"}],"version-history":[{"count":6,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":2341,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions\/2341"}],"wp:attachment":[{"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/esr.ibiblio.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}