# Modern C++ and ITK, a primer?

**URL:** https://discourse.itk.org/t/modern-c-and-itk-a-primer/1165
**Category:** Engineering
**Created:** [July 30, 2018, 7:56pm UTC](https://discourse.itk.org/t/modern-c-and-itk-a-primer/1165 "2018-07-30T19:56:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gdevenyi](https://discourse.itk.org/user_avatar/discourse.itk.org/gdevenyi/32/355_2.png) [@gdevenyi](https://discourse.itk.org/u/gdevenyi)
#### Post date: [July 30, 2018, 7:56pm UTC](https://discourse.itk.org/t/modern-c-and-itk-a-primer/1165/1 "2018-07-30T19:56:36Z")

</div>

Coming from the C world (and C on embedded systems) ITK uses a ton of C++ voodoo to achieve what it does.

Can anyone suggest a good modern primer to go about learning the modern C++ that ITK uses?

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [July 30, 2018, 10:43pm UTC](https://discourse.itk.org/t/modern-c-and-itk-a-primer/1165/2 "2018-07-30T22:43:35Z")

</div>

> [@gdevenyi](#):
>
> C++ voodoo

In the c++ slang, that’s officially called: template metaprogramming 😄

ITK doesn’t use super modern c++, ITKv5 encourages and allows c++11 features, but not beyond (c++14 or c++17 will surely be supported in future versions).

I am afraid of recommending any book, because there are many good ones that I haven’t read. But I can comment in the book-path that I took:  
I started with [C++ Primer](https://www.amazon.com/Primer-5th-Stanley-B-Lippman/dp/0321714113), which is an introductory book directly using c++11. Then I read the highly praised saga of Effective C++: [Modern, and Most Effective C++](https://www.amazon.com/Effective-Modern-Specific-Ways-Improve/dp/1491903996/ref=pd_sim_14_3?_encoding=UTF8&pd_rd_i=1491903996&pd_rd_r=e34631ef-9446-11e8-9259-4bb674a35291&pd_rd_w=KePZn&pd_rd_wg=91du8&pf_rd_i=desktop-dp-sims&pf_rd_m=ATVPDKIKX0DER&pf_rd_p=2610440344683357453&pf_rd_r=3W4M3KWTCKT7QD7N7D57&pf_rd_s=desktop-dp-sims&pf_rd_t=40701&psc=1&refRID=3W4M3KWTCKT7QD7N7D57), I also often consult [Concurrent C++](https://www.amazon.com/C-Concurrency-Action-Practical-Multithreading/dp/1933988770/ref=sr_1_3?s=books&ie=UTF8&qid=1532989771&sr=1-3&keywords=concurrent+c%2B%2B), but you don’t need it that much for `ITK`, because multi-threading is already ‘abstracted’ away from the developer. And finally, I highly recommend the [cpp-coreguidelines](https://github.com/isocpp/CppCoreGuidelines). They are in a reference-format, so the reading flow isn’t there, but they cover the topics really well, with best practices, and more than often good and practical examples. This one is a community effort started and supported by Bjarne, Herb Sutter, and other big names of c++.

For ITK specifics, the [Software Guide](https://itk.org/ItkSoftwareGuide.pdf) is the go-to reference source, with best practices, style guidelines, description of algorithms. It is pretty complete.

Also, [cpp slack](https://cpplang.slack.com/messages/C2SLQATS9) is a good learning resource and also a good way to be in contact with a really knowledgeable crew. The `learn` channel is friendly enough to any c++ question and people usually answer fast. There are many other specific channels: cmake, gpu, boost, template metaprogramming, etc, that you might find interesting over-time.

I would also recommend you to ask questions in the open here for specific issues you find in the learning process, I am sure we will all benefit from it, and hopefully help you in the way.
