{"id":5280,"date":"2017-06-30T17:38:18","date_gmt":"2017-06-30T17:38:18","guid":{"rendered":"https:\/\/www.modernescpp.com\/index.php\/c-core-guidelines-the-philosophy\/"},"modified":"2017-06-30T17:38:18","modified_gmt":"2017-06-30T17:38:18","slug":"c-core-guidelines-the-philosophy","status":"publish","type":"post","link":"https:\/\/www.modernescpp.com\/index.php\/c-core-guidelines-the-philosophy\/","title":{"rendered":"C++ Core Guidelines: The Philosophy"},"content":{"rendered":"<p>Today, I will dig deeper into the C++ Core Guidelines. I wrote about the Introduction section in my last post about the C++ Core Guidelines. Today I write about the section that is &#8220;primarily for humans&#8221;. This is the most general section and is called Philosophy. The rules are so general that you can apply them to each programming language.<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>Only to remind you. The C++ Core Guidelines consist of 350 rules. They a grouped in the following sections.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-introduction\">In: Introduction<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-philosophy\">P: Philosophy<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-interfaces\">I: Interfaces<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-functions\">F: Functions<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-class\">C: Classes and class hierarchies<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-enum\">Enum: Enumerations<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-resource\">R: Resource management<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-expr\">ES: Expressions and statements<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-errors\">E: Error handling<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-const\">Con: Constants and immutability<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-templates\">T: Templates and generic programming<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-concurrency\">CP: Concurrency<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-stdlib\">SL: The Standard library<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-source\">SF: Source files<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-cpl\">CPL: C-style programming<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-profile\">Pro: Profiles<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-gsl\">GSL: Guideline support library<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#S-faq\">FAQ: Answers to frequently asked questions<\/a><\/li>\n<\/ul>\n<p>Let&#8217;s look at each of the 13 philosophy rules. They should provide the rationale for all 350 rules.<a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines\"> <\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Philosophy\"><\/span>Philosophy<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>&nbsp;<img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-5279\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/06\/800px-Head_Platon_Glyptothek_Munich_548.jpg\" alt=\"800px Head Platon Glyptothek Munich 548\" width=\"200\" height=\"278\" style=\"margin: 15px;\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/06\/800px-Head_Platon_Glyptothek_Munich_548.jpg 800w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/06\/800px-Head_Platon_Glyptothek_Munich_548-216x300.jpg 216w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/06\/800px-Head_Platon_Glyptothek_Munich_548-737x1024.jpg 737w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2017\/06\/800px-Head_Platon_Glyptothek_Munich_548-768x1068.jpg 768w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/p>\n<p>The following 13 rules cannot be checked thoroughly. Here are they.<\/p>\n<ul>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-direct\">P.1: Express ideas directly in code<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-Cplusplus\">P.2: Write in ISO Standard C++<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-what\">P.3: Express intent<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-typesafe\">P.4: Ideally, a program should be statically type-safe<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-compile-time\">P.5: Prefer compile-time checking to run-time checking<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-run-time\">P.6: What cannot be checked at compile-time should be checkable at run time<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-early\">P.7: Catch run-time errors early<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-leak\">P.8: Don\u2019t leak any resources<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-waste\">P.9: Don\u2019t waste time or space<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-mutable\">P.10: Prefer immutable data to mutable data<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-library\">P.11: Encapsulate messy constructs, rather than spreading through the code<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-tools\">P.12: Use supporting tools as appropriate<\/a><\/li>\n<li><a href=\"http:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines#Rp-lib\">P.13: Use support libraries as appropriate<\/a><\/li>\n<\/ul>\n<p>I will provide examples from the C++ Core Guidelines for each rule if possible.<\/p>\n<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Express_ideas_directly_in_code\"><\/span>Express ideas directly in code<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A method should express its intent. Have a look here.<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #006699; font-weight: bold;\">class<\/span> <span style=\"color: #00aa88; font-weight: bold;\">Date<\/span> {\r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n<span style=\"color: #9999ff;\">public:<\/span>\r\n    Month month() <span style=\"color: #006699; font-weight: bold;\">const<\/span>;  <span style=\"color: #0099ff; font-style: italic;\">\/\/ do    <\/span>\r\n    <span style=\"color: #007788; font-weight: bold;\">int<\/span> <span style=\"color: #cc00ff;\">month<\/span>();          <span style=\"color: #0099ff; font-style: italic;\">\/\/ don't<\/span>\r\n    <span style=\"color: #0099ff; font-style: italic;\">\/\/ ...<\/span>\r\n};\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Neither does the second method <span style=\"font-family: courier new,courier;\">month<\/span> express that it will not change the instance nor return a&nbsp;<span style=\"font-family: courier new,courier;\">Month<\/span> object.<\/p>\n<p>The same reasoning often holds for explicit loops versus algorithms of the Standard Template Library (STL).<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007788; font-weight: bold;\">int<\/span> index <span style=\"color: #555555;\">=<\/span> <span style=\"color: #555555;\">-<\/span><span style=\"color: #ff6600;\">1<\/span>;                    <span style=\"color: #0099ff; font-style: italic;\">\/\/ bad<\/span>\r\n<span style=\"color: #006699; font-weight: bold;\">for<\/span> (<span style=\"color: #007788; font-weight: bold;\">int<\/span> i <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">0<\/span>; i <span style=\"color: #555555;\">&lt;<\/span> v.size(); <span style=\"color: #555555;\">++<\/span>i) {\r\n    <span style=\"color: #006699; font-weight: bold;\">if<\/span> (v[i] <span style=\"color: #555555;\">==<\/span> val) {\r\n      index <span style=\"color: #555555;\">=<\/span> i;\r\n      <span style=\"color: #006699; font-weight: bold;\">break<\/span>;\r\n    }\r\n}\r\n\r\n<span style=\"color: #006699; font-weight: bold;\">auto<\/span> p <span style=\"color: #555555;\">=<\/span> find(begin(v), end(v), val);  <span style=\"color: #0099ff; font-style: italic;\">\/\/ better<\/span>\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The meta-rule is obvious. You should know and use the algorithms of the STL.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Write_in_ISO_Standard_C\"><\/span>Write in ISO Standard C++<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This rule is simple and has a straightforward enforcement statement: &#8220;Use an up-to-date C++ compiler (currently C++11 or C++14) with a set of options that do not accept extensions.&#8221;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Express_intent\"><\/span>Express intent<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Your code should express its intent. What can we deduce from the three explicit and implicit loops?<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #006699; font-weight: bold;\">for<\/span> (<span style=\"color: #006699; font-weight: bold;\">const<\/span> <span style=\"color: #006699; font-weight: bold;\">auto<\/span><span style=\"color: #555555;\">&amp;<\/span> v<span style=\"color: #555555;\">:<\/span> vec) { ... }       (<span style=\"color: #ff6600;\">1<\/span>)\r\n<span style=\"color: #006699; font-weight: bold;\">for<\/span> (<span style=\"color: #006699; font-weight: bold;\">auto<\/span><span style=\"color: #555555;\">&amp;<\/span> v<span style=\"color: #555555;\">:<\/span> vec){ ... }              (<span style=\"color: #ff6600;\">2<\/span>)\r\nfor_each(par, vec, [](<span style=\"color: #006699; font-weight: bold;\">auto<\/span> v){ ... }); (<span style=\"color: #ff6600;\">3<\/span>)\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The elements of the container <span style=\"font-family: courier new,courier;\">vec<\/span> will not be modified in (1). On the contrary, the elements in expression (2) will be modified. The algorithm<span style=\"font-family: courier new,courier;\"> for_each<\/span> is executed with the parallel execution policy (<span style=\"font-family: courier new,courier;\">par<\/span>). That means the order of iteration does not matter.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Ideally_a_program_should_be_statically_type-safe\"><\/span>Ideally, a program should be statically type-safe<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You should strive for statically type-safe programs. Of course, that is impossible because there are problem areas in C++. The C++ Core Guidelines name the problem areas and possible solutions.<\/p>\n<ul>\n<li>use <span style=\"font-family: courier new,courier;\">std::variant<\/span> (new with C++17) instead of unions<\/li>\n<li>minimize the use of casts; use templates if possible<\/li>\n<li>use <span style=\"font-family: courier new,courier;\">gsl::span<\/span> against array decay&nbsp;(if you pass an array to a function, it will implicitly decay to a pointer) and range errors<\/li>\n<li>minimize narrowing conversions (narrowing conversion is an implicit conversion including the loss of data accuracy; for example, a <span style=\"font-family: courier new,courier;\">double<\/span> becomes an <span style=\"font-family: courier new, courier;\">int<\/span> implicitly)<\/li>\n<\/ul>\n<p>gsl stands for Guideline support library GSL. GSL is a small library to support the set of guidelines from the C++ Core Guidelines. I will write about the GSL in an upcoming post.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Prefer_compile-time_checking_to_run-time_checking\"><\/span>Prefer compile-time checking to run-time checking<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>All that can be done at compile time must not be done at run time. Since C++11, we have the function <span style=\"font-family: courier new,courier;\">static_assert<\/span> and the type-traits library. <span style=\"font-family: courier new,courier;\">static_assert<\/span> will check a predicate such as <span style=\"font-family: courier new,courier;\">static_assert(sizeof(int) &gt;= 4)<\/span> at compile time. Thanks to the type-traits library, we can state powerful conditions about a type <span style=\"font-family: courier new,courier;\">T<\/span> at compile time: <span style=\"font-family: courier new,courier;\">static_assert(std::is_integral&lt;T&gt;::value).<\/span> Of course, if the check fails at compile-time, the compilation will fail with a readable error message.<span style=\"font-family: courier new,courier;\"> I <\/span>already wrote about<span style=\"font-family: courier new,courier;\"> <a href=\"https:\/\/www.modernescpp.com\/index.php\/tag\/static-assert\"><span style=\"font-family: courier new,courier;\">static_assert.<\/span><\/a><\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_cannot_be_checked_at_compile-time_should_be_checkable_at_run_time\"><\/span>What cannot be checked at compile-time should be checkable at run time<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This rule talks about hard-to-detect errors that should be avoided. The examples are about dynamically allocated arrays.<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #006699; font-weight: bold;\">extern<\/span> <span style=\"color: #007788; font-weight: bold;\">void<\/span> <span style=\"color: #cc00ff;\">f<\/span>(<span style=\"color: #007788; font-weight: bold;\">int<\/span><span style=\"color: #555555;\">*<\/span> p);\r\n<span style=\"color: #006699; font-weight: bold;\">extern<\/span> <span style=\"color: #007788; font-weight: bold;\">void<\/span> <span style=\"color: #cc00ff;\">f2<\/span>(<span style=\"color: #007788; font-weight: bold;\">int<\/span><span style=\"color: #555555;\">*<\/span> p, <span style=\"color: #007788; font-weight: bold;\">int<\/span> n);\r\n<span style=\"color: #006699; font-weight: bold;\">extern<\/span> <span style=\"color: #007788; font-weight: bold;\">void<\/span> <span style=\"color: #cc00ff;\">f3<\/span>(unique_ptr<span style=\"color: #555555;\">&lt;<\/span><span style=\"color: #007788; font-weight: bold;\">int<\/span>[]<span style=\"color: #555555;\">&gt;<\/span> uniq, <span style=\"color: #007788; font-weight: bold;\">int<\/span> n);\r\n\r\nf(<span style=\"color: #006699; font-weight: bold;\">new<\/span> <span style=\"color: #007788; font-weight: bold;\">int<\/span>[n]);                  (<span style=\"color: #ff6600;\">1<\/span>)\r\nf2(<span style=\"color: #006699; font-weight: bold;\">new<\/span> <span style=\"color: #007788; font-weight: bold;\">int<\/span>[n], m);              (<span style=\"color: #ff6600;\">2<\/span>)\r\nf3(make_unique<span style=\"color: #555555;\">&lt;<\/span><span style=\"color: #007788; font-weight: bold;\">int<\/span>[]<span style=\"color: #555555;\">&gt;<\/span>(n), m);   (<span style=\"color: #ff6600;\">3<\/span>)\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>What&#8217;s wrong with the example? The call (1) does not pass the number of elements. (2) makes passing the wrong number of elements possible, and (3) passes the ownership and the size separately. By bypassing a reference or a view (part of the gsl) you can overcome these issues.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Catch_run-time_errors_early\"><\/span>Catch run-time errors early<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Here are the enforcements for this rule:<\/p>\n<ul>\n<li>Look at pointers and arrays: Do range-checking early and not repeatedly<\/li>\n<li>Look at conversions: Eliminate or mark narrowing conversions<\/li>\n<li>Look for unchecked values coming from the input<\/li>\n<li>Look for structured data (objects of classes with invariants) being converted into strings<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Dont_leak_any_resource\"><\/span>Don&#8217;t leak any resource<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Leaking resources are, in particular, critical for long-running programs. Resources may be memory but also file handles or sockets. The idiomatic way to solve this issue is RAII. The idea of the RAII idiom is quite simple. You bind a resource&#8217;s acquisition and release to the lifetime of a local object. Therefore, the resource will automatically be initialized in the constructor and released in the destructor. The acronym RAII stands for <strong>R<\/strong>esource <strong>A<\/strong>cquisition <strong>I<\/strong>s <strong>I<\/strong>nitialization. Smart pointers and locks are based on this technique. Here are more details of<a href=\"https:\/\/www.modernescpp.com\/index.php\/garbage-collectio-no-thanks\"> RAII<\/a>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Dont_waste_time_or_space\"><\/span>Don&#8217;t waste time or space<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The reason for this rule is quite promising: &#8220;This is C++&#8221;. One example of the rule is a riddle.<\/p>\n<p>What&#8217;s wasted here?<\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007788; font-weight: bold;\">void<\/span> <span style=\"color: #cc00ff;\">lower<\/span>(string s)\r\n{\r\n    <span style=\"color: #006699; font-weight: bold;\">for<\/span> (<span style=\"color: #007788; font-weight: bold;\">int<\/span> i <span style=\"color: #555555;\">=<\/span> <span style=\"color: #ff6600;\">0<\/span>; i <span style=\"color: #555555;\">&lt;<\/span> strlen(s); <span style=\"color: #555555;\">++<\/span>i) s[i] <span style=\"color: #555555;\">=<\/span> tolower(s[i]);\r\n}\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Prefer_immutable_data_to_mutable_data\"><\/span>Prefer immutable data to mutable data<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There are a lot of reasons that speak for immutable data:<\/p>\n<ul>\n<li>It&#8217;s easier to reason about constants than about variables.<\/li>\n<li>Constant has more optimization potential.<\/li>\n<li>Constants are free of <span style=\"font-family: courier new,courier;\">data races<\/span>.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Encapsulate_messy_constructs_rather_than_spreading_through_the_code\"><\/span>Encapsulate messy constructs rather than spreading through the code<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Messy code is prone to bugs and harder to write. Therefore, you should encapsulate the low-level code in a function or a method and put a good interface around it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Use_supporting_tools_as_appropriate\"><\/span>Use supporting tools as appropriate<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Computers are better than humans at doing boring and repetitive tasks. That means you should use static analysis, concurrency, and testing tools to automate these verifying steps.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Use_support_libraries_as_appropriate\"><\/span>Use support libraries as appropriate<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>That is quite easy to explain. It would be best to go for well-designed, well-documented, and well-supported libraries. Therefore, you will get a well-tested and nearly error-free library and highly optimized algorithms from domain experts. Two outstanding examples are the C++ standard library and the Guidelines Support Library.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Whats_next\"><\/span>What&#8217;s next?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>An interface is a contract between the service provider and the service user. There are 20 rules about interfaces in the C++ Core Guidelines. In the <a href=\"https:\/\/www.modernescpp.com\/index.php\/c-core-guidelines-interfaces\">next post<\/a>, I will have a closer look at interfaces.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, I will dig deeper into the C++ Core Guidelines. I wrote about the Introduction section in my last post about the C++ Core Guidelines. Today I write about the section that is &#8220;primarily for humans&#8221;. This is the most general section and is called Philosophy. The rules are so general that you can apply [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":5279,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[372],"tags":[],"class_list":["post-5280","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-modern-c"],"_links":{"self":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/5280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/comments?post=5280"}],"version-history":[{"count":0,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/5280\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media\/5279"}],"wp:attachment":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=5280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=5280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=5280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}