{"id":1929,"date":"2024-03-14T12:08:44","date_gmt":"2024-03-14T16:08:44","guid":{"rendered":"https:\/\/www.wellformedness.com\/blog\/?p=1929"},"modified":"2024-04-03T10:03:05","modified_gmt":"2024-04-03T14:03:05","slug":"self-taught-cpp","status":"publish","type":"post","link":"https:\/\/www.wellformedness.com\/blog\/self-taught-cpp\/","title":{"rendered":"Self-taught C++"},"content":{"rendered":"<p>I have recently fielded a few requests from students about self-directed learning of C++. I thought I&#8217;d combine my notes here. So, compared to Python for instance, C++ is a very large language both in terms of syntactic richness and the large standard library. Secondly, it has been popular for at least two decades longer than Python, so there is a lot of really dated material out there that doesn&#8217;t incorporate the huge positive changes to the language made in C++11.<\/p>\n<p>I recommend two books. First and most importantly is the 4th edition of (C++ creator) Bjarne Stroustrup&#8217;s\u00a0<em><a href=\"https:\/\/www.amazon.com\/Programming-Language-hardcover-4th\/dp\/0321958322\/ref=pd_lpo_sccl_1\/144-6049609-8438138?pd_rd_w=BsDqs&amp;content-id=amzn1.sym.1ad2066f-97d2-4731-9356-36b3edf1ae04&amp;pf_rd_p=1ad2066f-97d2-4731-9356-36b3edf1ae04&amp;pf_rd_r=Y3NMCYKH3E8Q55HY133Z&amp;pd_rd_wg=B4fcG&amp;pd_rd_r=df52e110-fcfe-47ee-9aa7-fd0204c32c51&amp;pd_rd_i=0321958322&amp;psc=1\">The C++ Programming Language<\/a>. <\/em>This is a gigantic hardback textbook that basically covers everything you need to know through C++11. It does not cover C++14, C++17, C++20, or C++23, but those are all pretty minor changes by comparison, and you&#8217;ll catch on. Stroustrup is actually a pretty good technical writer, too. (If a 5th edition ever comes out, get that one instead.) The other one I recommend is the Scott Myers&#8217; <a href=\"https:\/\/www.amazon.com\/Effective-Modern-Specific-Ways-Improve-ebook\/dp\/B00PGCMGDQ?ref_=ast_author_mpb\"><em>Effective Modern C++<\/em><\/a>, a smaller book which focuses on the newer C++11 and C++14 features. Myers&#8217; book is structured like a series of essays about when and how to incorporate these new features.<\/p>\n<p>There are two other things I recommend that aspiring C++ users use. The first is a good style guide. C++ just isn&#8217;t very opinionated, but good code is. I definitely recommend the widely-used <a href=\"https:\/\/google.github.io\/styleguide\/cppguide.html\">Google C++ style guide<\/a>, but I&#8217;m sure there are other good ones out there. The second is <a href=\"https:\/\/godbolt.org\/\">Godbolt<\/a>, an incredible website that combines the functionality of a pastebin with an in-browser compiler.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have recently fielded a few requests from students about self-directed learning of C++. I thought I&#8217;d combine my notes here. So, compared to Python for instance, C++ is a very large language both in terms of syntactic richness and the large standard library. Secondly, it has been popular for at least two decades longer &hellip; <a href=\"https:\/\/www.wellformedness.com\/blog\/self-taught-cpp\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Self-taught C++&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-1929","post","type-post","status-publish","format-standard","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/posts\/1929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/comments?post=1929"}],"version-history":[{"count":7,"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/posts\/1929\/revisions"}],"predecessor-version":[{"id":1944,"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/posts\/1929\/revisions\/1944"}],"wp:attachment":[{"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/media?parent=1929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/categories?post=1929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellformedness.com\/blog\/wp-json\/wp\/v2\/tags?post=1929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}