Arnaud Porterie - The Truth About C++

1,944 views

Published on

Talk for While 42 Paris, September 12th @ Société Générale CIB

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,944
On SlideShare
0
From Embeds
0
Number of Embeds
506
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Arnaud Porterie - The Truth About C++

  1. 1. The * truth about C++ * Commonly accepted among a representative population of 1 Arnaud Porterie – While42 Paris – 20130912 Thursday, September 12, 13
  2. 2. Who am I? • Arnaud Porterie - @icecrime • Epitech 2007 • Mostly worked with C++ since then Thursday, September 12, 13
  3. 3. Objectives of this talk Thursday, September 12, 13
  4. 4. Objectives of this talk • Discuss common misconceptions Thursday, September 12, 13
  5. 5. Objectives of this talk • Discuss common misconceptions • Understand the recent hype Thursday, September 12, 13
  6. 6. Objectives of this talk • Discuss common misconceptions • Understand the recent hype • Show that C++ has a (bright) future Thursday, September 12, 13
  7. 7. 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
  8. 8. 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
  9. 9. C++ misconceptions Thursday, September 12, 13
  10. 10. #1 - C++ never evolves Thursday, September 12, 13
  11. 11. C++98 C++03 2002 1998 2005 2007 2003 C# 1.0 Thursday, September 12, 13 C++11 2010 2013 2011 C# 2.0 C# 3.0 C# 4.0 C# 5.0
  12. 12. 13 years for a new C++? Thursday, September 12, 13
  13. 13. 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
  14. 14. • Community driven evolution • Committee standardized already widely adopted libraries • C++11 also adds many new language features and libraries Thursday, September 12, 13
  15. 15. #2 - C++ is about manual memory management Thursday, September 12, 13
  16. 16. 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
  17. 17. Pro tip #1 Want to test if someone knows C++? Thursday, September 12, 13
  18. 18. Pro tip #1 Want to test if someone knows C++? Ask about memory management. Thursday, September 12, 13
  19. 19. Pro tip #2 Just ignore any wrong answer to #1. Thursday, September 12, 13
  20. 20. Pro tip #2 Just ignore any wrong answer to #1. You’ll never recruit anyone. Thursday, September 12, 13
  21. 21. #3 - C++ is too hard Thursday, September 12, 13
  22. 22. Can’t really deny that... Thursday, September 12, 13
  23. 23. 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
  24. 24. Multi-paradigm language • Procedural • Generic • Functional • Object-oriented • Variety does not make things easier for the newcomer Thursday, September 12, 13
  25. 25. So, is C++ is back? Thursday, September 12, 13
  26. 26. • 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
  27. 27. What future for C++ ? Thursday, September 12, 13
  28. 28. Choosing C++ is a case of premature optimization – Miguel de Icaza Xamarin CTO & level 60 troll Thursday, September 12, 13
  29. 29. • 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
  30. 30. Phase/trend Major constraints 2x efficient apps runs... 1950s - 1990s Compute-constrainted Processor 2x compute speed 2x users 1995ish - 2007ish Surplus local compute + low UI innovation (WIMP) Programmer time n/a 200x Mobile Processor Power (battery life) 2x compute speed 2x 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 power 2x compute speed Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk Thursday, September 12, 13
  31. 31. Phase/trend Major constraints 2x efficient apps runs... 1950s - 1990s Compute-constrainted Processor 2x compute speed 2x users 1995ish - 2007ish Surplus local compute + low UI innovation (WIMP) Programmer time n/a 200x Mobile Processor Power (battery life) 2x compute speed 2x 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 power 2x compute speed Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk Thursday, September 12, 13
  32. 32. Phase/trend Major constraints 2x efficient apps runs... 1950s - 1990s Compute-constrainted Processor 2x compute speed 2x users 1995ish - 2007ish Surplus local compute + low UI innovation (WIMP) Programmer time n/a 200x Mobile Processor Power (battery life) 2x compute speed 2x 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 power 2x compute speed Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk Thursday, September 12, 13
  33. 33. Phase/trend Major constraints 2x efficient apps runs... 1950s - 1990s Compute-constrainted Processor 2x compute speed 2x users 1995ish - 2007ish Surplus local compute + low UI innovation (WIMP) Programmer time n/a 200x Mobile Processor Power (battery life) 2x compute speed 2x 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 power 2x compute speed Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk Thursday, September 12, 13
  34. 34. Phase/trend Major constraints 2x efficient apps runs... 1950s - 1990s Compute-constrainted Processor 2x compute speed 2x users 1995ish - 2007ish Surplus local compute + low UI innovation (WIMP) Programmer time n/a 200x Mobile Processor Power (battery life) 2x compute speed 2x 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 power 2x compute speed Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk Thursday, September 12, 13
  35. 35. Phase/trend Major constraints 2x efficient apps runs... 1950s - 1990s Compute-constrainted Processor 2x compute speed 2x users 1995ish - 2007ish Surplus local compute + low UI innovation (WIMP) Programmer time n/a 200x Mobile Processor Power (battery life) 2x compute speed 2x 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 power 2x compute speed Shamelessly stolen from Herb Sutter’s “Not your father’s C++” talk Thursday, September 12, 13
  36. 36. Find your biggest cost, and optimize for that Thursday, September 12, 13
  37. 37. Example - Facebook Thursday, September 12, 13
  38. 38. • Hip Hop Compiler • HHVM JIT Compiler • 5x faster than the interpreter Thursday, September 12, 13
  39. 39. There are only two kinds of language: the ones people complain about and the ones nobody uses – Bjarne Stroustrup Thursday, September 12, 13
  40. 40. Questions? Thursday, September 12, 13

×