{"id":1822,"date":"2024-06-05T17:14:44","date_gmt":"2024-06-05T17:14:44","guid":{"rendered":"https:\/\/cppdepend.com\/blog\/?p=1822"},"modified":"2024-06-12T10:16:51","modified_gmt":"2024-06-12T10:16:51","slug":"orthodox-c-fans-are-they-a-minority-or-a-silent-majority","status":"publish","type":"post","link":"https:\/\/cppdepend.com\/blog\/orthodox-c-fans-are-they-a-minority-or-a-silent-majority\/","title":{"rendered":"Orthodox C++ fans: are they a minority or a silent majority?"},"content":{"rendered":"\n<p>Bloggers, influencers, and the C++ Standard Committee actively advocate for the use of Modern C++. Through articles, tutorials, and social media, bloggers and influencers highlight the benefits and innovative features of the latest C++ standards, aiming to educate and inspire the programming community. Their collective efforts are geared towards encouraging developers to adopt Modern C++, leveraging its advanced capabilities to write more efficient, maintainable, and robust code.<\/p>\n\n\n\n<p>However, not all C++ developers agree with adopting Modern C++ for various reasons, leading to the emergence of the Orthodox C++ approach, which advocates for using a minimal subset of C++.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Orthodox C++, as defined by its <a href=\"https:\/\/gist.github.com\/bkaradzic\/2e39896bc7d8c34e042b\">fans<\/a><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Orthodox C++ (sometimes referred as\u00a0<strong>C+<\/strong>) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It&#8217;s exactly opposite of what\u00a0Modern C++\u00a0suppose to be.<\/p>\n<\/blockquote>\n\n\n\n<p>To resume, Orthodox C++ fans are adopters of the C++ presented by Bjarne Stroustrap 40 years ago:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"The Design of C++ , lecture by Bjarne Stroustrup\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/69edOm889V4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Here are some projects sample of the Orthodox C++ approach: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/id-Software\/DOOM-3-BFG\">DOOM 3 BFG<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/qtproject\">Qt<\/a>\u00a0(when built with no-rtti, no-exceptions)<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/ocornut\/imgui\">dear imgui<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/bkaradzic\/bgfx\">bgfx<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/ConfettiFX\/The-Forge\">TheForge<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/floooh\/oryol\">Oryol<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/networknext\/sdk\">Network Next SDK<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Orthodox C++ prefered rules:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C-like C++ is good start, if code doesn&#8217;t require more complexity don&#8217;t add unnecessary C++ complexities. In general case code should be readable to anyone who is familiar with C language.<\/li>\n\n\n\n<li>Don&#8217;t do\u00a0<a href=\"http:\/\/archive.md\/2014.04.28-125041\/http:\/\/www.boost.org\/doc\/libs\/1_55_0\/libs\/geometry\/doc\/html\/geometry\/design.html\">this<\/a>, the end of &#8220;design rationale&#8221; in Orthodox C++ should be immedately after &#8220;Quite simple, and it is usable.\u00a0<strong>EOF<\/strong>&#8220;.<\/li>\n\n\n\n<li>Don&#8217;t use\u00a0<a href=\"https:\/\/web.archive.org\/web\/20190116034706\/http:\/\/www.lighterra.com\/papers\/exceptionsharmful\/\">exceptions<\/a>.<\/li>\n\n\n\n<li>Don&#8217;t use RTTI.<\/li>\n\n\n\n<li>Don&#8217;t use C++ runtime wrapper for C runtime includes (<code>&lt;cstdio><\/code>,\u00a0<code>&lt;cmath><\/code>, etc.), use C runtime instead (<code>&lt;stdio.h><\/code>,\u00a0<code>&lt;math.h><\/code>, etc.)<\/li>\n\n\n\n<li>Don&#8217;t use stream (<code>&lt;iostream><\/code>,\u00a0<code>&lt;stringstream><\/code>, etc.), use printf style functions instead.<\/li>\n\n\n\n<li>Don&#8217;t use anything from STL that allocates memory.<\/li>\n\n\n\n<li>Don&#8217;t use metaprogramming excessively for academic masturbation. Use it in moderation, only where necessary, and where it reduces code complexity.<\/li>\n<\/ul>\n\n\n\n<p>As we can see, proponents of Orthodox C++ advocate for using a minimal subset of C++, but web resources indicate that they are in the minority. Indeed, the majority supports the use of Modern C++. However, when it comes to the broader C++ developer community, the question remains: are most developers actively using modern C++ features, or do they primarily rely on basic C++ concepts?<\/p>\n\n\n\n<p>We can&#8217;t have a precise answer to this, but it is clear that many projects still adhere to the Orthodox C++ approach due to their legacy codebases. This often prevents developers from transitioning to Modern C++, resulting in a continued emphasis on basic C++ concepts.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bloggers, influencers, and the C++ Standard Committee actively advocate for the use of Modern C++. Through articles, tutorials, and social media, bloggers and influencers highlight the benefits and innovative features of the latest C++ standards, aiming to educate and inspire the programming community. Their collective efforts are geared towards encouraging developers to adopt Modern C++, &hellip; <a href=\"https:\/\/cppdepend.com\/blog\/orthodox-c-fans-are-they-a-minority-or-a-silent-majority\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Orthodox C++ fans: are they a minority or a silent majority?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[619,379,561,603,602,623,625,150,475,606,624,604,611,71,607,608,601,609,610,612,18,618,616,613,330,614,605,30,622,600,621,617,615,620],"class_list":["post-1822","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bgfx","tag-bjarne-stroustrup","tag-c-best-practices","tag-c-bloggers","tag-c-community","tag-c-complexity","tag-c-developer-preferences","tag-c-development","tag-c-evolution","tag-c-exceptions","tag-c-features-adoption","tag-c-influencers","tag-c-metaprogramming","tag-c-programming","tag-c-rtti","tag-c-runtime","tag-c-standard-committee","tag-c-stl","tag-c-streams","tag-c-like-c","tag-cppdepend","tag-dear-imgui","tag-doom-3-bfg","tag-efficient-c-code","tag-legacy-code","tag-maintainable-c-code","tag-minimal-c-subset","tag-modern-c","tag-network-next-sdk","tag-orthodox-c","tag-oryol","tag-qt-framework","tag-robust-c-code","tag-theforge"],"_links":{"self":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/1822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/comments?post=1822"}],"version-history":[{"count":5,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/1822\/revisions"}],"predecessor-version":[{"id":1828,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/1822\/revisions\/1828"}],"wp:attachment":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/media?parent=1822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/categories?post=1822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/tags?post=1822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}