arnaud porterie - the truth about c++
DESCRIPTION
Talk for While 42 Paris, September 12th @ Société Générale CIBTRANSCRIPT
![Page 1: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/1.jpg)
The truth* about C++* Commonly accepted among a representative population of 1
Arnaud Porterie – While42 Paris – 20130912Thursday, September 12, 13
![Page 2: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/2.jpg)
Who am I?
• Arnaud Porterie - @icecrime
• Epitech 2007
• Mostly worked with C++ since then
Thursday, September 12, 13
![Page 3: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/3.jpg)
Objectives of this talk
Thursday, September 12, 13
![Page 4: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/4.jpg)
Objectives of this talk
• Discuss common misconceptions
Thursday, September 12, 13
![Page 5: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/5.jpg)
Objectives of this talk
• Discuss common misconceptions
• Understand the recent hype
Thursday, September 12, 13
![Page 6: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/6.jpg)
Objectives of this talk
• Discuss common misconceptions
• Understand the recent hype
• Show that C++ has a (bright) future
Thursday, September 12, 13
![Page 7: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/7.jpg)
Objectives of this talk
• Discuss common misconceptions
• Understand the recent hype
• Show that C++ has a (bright) future
• In less than 1/2h
Thursday, September 12, 13
![Page 8: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/8.jpg)
Objectives of this talk
• Discuss common misconceptions
• Understand the recent hype
• Show that C++ has a (bright) future
• In less than 1/2h
• Without showing code
Thursday, September 12, 13
![Page 9: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/9.jpg)
C++ misconceptions
Thursday, September 12, 13
![Page 10: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/10.jpg)
#1 - C++ never evolves
Thursday, September 12, 13
![Page 11: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/11.jpg)
1998
C++98
2002
C# 1.0
2003
C++03
2011
C++11
2005
C# 2.0
2007
C# 3.0
2010
C# 4.0
2013
C# 5.0
Thursday, September 12, 13
![Page 12: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/12.jpg)
13 years for a new C++?
Thursday, September 12, 13
![Page 13: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/13.jpg)
Evolution didn’t wait for a new standard
• C++ changed radically in the past decade
• So called “Modern C++”
• “Modern C++ design”, A. Alexandrescu, 2001
• Boost library, the standard’s sandbox
Thursday, September 12, 13
![Page 14: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/14.jpg)
• Community driven evolution
• Committee standardized already widely adopted libraries
• C++11 also adds many new language features and libraries
Thursday, September 12, 13
![Page 15: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/15.jpg)
#2 - C++ is about manual memory management
Thursday, September 12, 13
![Page 16: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/16.jpg)
C++ greatest myth
• If you delete, you’re doing it wrong
• RAII is C++ most important idiom
• The stack is fast and foolproof
• std::shared_ptr, std::unique_ptr, ...
Thursday, September 12, 13
![Page 17: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/17.jpg)
Want to test if someone knows C++?
Pro tip #1
Thursday, September 12, 13
![Page 18: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/18.jpg)
Want to test if someone knows C++?
Ask about memory management.
Pro tip #1
Thursday, September 12, 13
![Page 19: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/19.jpg)
Just ignore any wrong answer to #1.
Pro tip #2
Thursday, September 12, 13
![Page 20: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/20.jpg)
Just ignore any wrong answer to #1.
You’ll never recruit anyone.
Pro tip #2
Thursday, September 12, 13
![Page 21: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/21.jpg)
#3 - C++ is too hard
Thursday, September 12, 13
![Page 22: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/22.jpg)
Can’t really deny that...
Thursday, September 12, 13
![Page 23: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/23.jpg)
It’s not getting any better
• ISO/IEC 14882:2003: 786 pages
• ISO/IEC 14882:2011: 1328 pages
• C++11 is supposedly more accessible
• I say C++11 can’t properly be used without a good understanding of C++03
Thursday, September 12, 13
![Page 24: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/24.jpg)
• Procedural
• Generic
• Functional
• Object-oriented
• Variety does not make things easier for the newcomer
Multi-paradigm language
Thursday, September 12, 13
![Page 25: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/25.jpg)
So, is C++ is back?
Thursday, September 12, 13
![Page 26: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/26.jpg)
• Was it ever gone?
• The world is built on C++!
• One thing has changed: C++ is back as a first class language in Microsoft’s strategy
Thursday, September 12, 13
![Page 27: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/27.jpg)
What future for C++ ?
Thursday, September 12, 13
![Page 28: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/28.jpg)
Choosing C++ is a case of premature optimization
– Miguel de IcazaXamarin CTO & level 60 troll
Thursday, September 12, 13
![Page 29: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/29.jpg)
• The tradeoff between productivity and control is not as huge as most believe
• The real question is: today, are there that many problems that justify the extra effort?
Thursday, September 12, 13
![Page 30: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/30.jpg)
Phase/trend Major constraints 2x efficient apps runs...
1950s - 1990sCompute-constrainted
Processor2x compute speed
2x users
1995ish - 2007ishSurplus local compute +
low UI innovation (WIMP)Programmer time n/a
200x -Mobile
ProcessorPower (battery life)
2x compute speed2x battery life
2009 -Cloud
Power (31%)Server HW (57%)
0.5x power 0.5x nodes
2009 -Heterogeneous cores,
GPGPU
Power (dark silicon)Processor
0.5x power2x compute speed
Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk
Thursday, September 12, 13
![Page 31: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/31.jpg)
Phase/trend Major constraints 2x efficient apps runs...
1950s - 1990sCompute-constrainted
Processor2x compute speed
2x users
1995ish - 2007ishSurplus local compute +
low UI innovation (WIMP)Programmer time n/a
200x -Mobile
ProcessorPower (battery life)
2x compute speed2x battery life
2009 -Cloud
Power (31%)Server HW (57%)
0.5x power 0.5x nodes
2009 -Heterogeneous cores,
GPGPU
Power (dark silicon)Processor
0.5x power2x compute speed
Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk
Thursday, September 12, 13
![Page 32: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/32.jpg)
Phase/trend Major constraints 2x efficient apps runs...
1950s - 1990sCompute-constrainted
Processor2x compute speed
2x users
1995ish - 2007ishSurplus local compute +
low UI innovation (WIMP)Programmer time n/a
200x -Mobile
ProcessorPower (battery life)
2x compute speed2x battery life
2009 -Cloud
Power (31%)Server HW (57%)
0.5x power 0.5x nodes
2009 -Heterogeneous cores,
GPGPU
Power (dark silicon)Processor
0.5x power2x compute speed
Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk
Thursday, September 12, 13
![Page 33: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/33.jpg)
Phase/trend Major constraints 2x efficient apps runs...
1950s - 1990sCompute-constrainted
Processor2x compute speed
2x users
1995ish - 2007ishSurplus local compute +
low UI innovation (WIMP)Programmer time n/a
200x -Mobile
ProcessorPower (battery life)
2x compute speed2x battery life
2009 -Cloud
Power (31%)Server HW (57%)
0.5x power 0.5x nodes
2009 -Heterogeneous cores,
GPGPU
Power (dark silicon)Processor
0.5x power2x compute speed
Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk
Thursday, September 12, 13
![Page 34: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/34.jpg)
Phase/trend Major constraints 2x efficient apps runs...
1950s - 1990sCompute-constrainted
Processor2x compute speed
2x users
1995ish - 2007ishSurplus local compute +
low UI innovation (WIMP)Programmer time n/a
200x -Mobile
ProcessorPower (battery life)
2x compute speed2x battery life
2009 -Cloud
Power (31%)Server HW (57%)
0.5x power 0.5x nodes
2009 -Heterogeneous cores,
GPGPU
Power (dark silicon)Processor
0.5x power2x compute speed
Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk
Thursday, September 12, 13
![Page 35: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/35.jpg)
Phase/trend Major constraints 2x efficient apps runs...
1950s - 1990sCompute-constrainted
Processor2x compute speed
2x users
1995ish - 2007ishSurplus local compute +
low UI innovation (WIMP)Programmer time n/a
200x -Mobile
ProcessorPower (battery life)
2x compute speed2x battery life
2009 -Cloud
Power (31%)Server HW (57%)
0.5x power 0.5x nodes
2009 -Heterogeneous cores,
GPGPU
Power (dark silicon)Processor
0.5x power2x compute speed
Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk
Thursday, September 12, 13
![Page 36: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/36.jpg)
Find your biggest cost, and optimize for that
Thursday, September 12, 13
![Page 37: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/37.jpg)
Example - Facebook
Thursday, September 12, 13
![Page 38: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/38.jpg)
• Hip Hop Compiler
• HHVM JIT Compiler
• 5x faster than the interpreter
Thursday, September 12, 13
![Page 39: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/39.jpg)
There are only two kinds of language: the ones people complain about and the ones nobody uses
– Bjarne Stroustrup
Thursday, September 12, 13
![Page 40: Arnaud Porterie - The Truth About C++](https://reader034.vdocument.in/reader034/viewer/2022051400/5596c27f1a28abb4038b470c/html5/thumbnails/40.jpg)
Questions?
Thursday, September 12, 13