SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
The Renaissance of C++
by Victor Haydin, Head of R&D Office, ELEKS
Agenda
A bit of C++ history
Why C++ is popular again?
The future of C++
Quick Survey
What programming languages do you know?
A bit of C++ history
The Prehistoric Age
         (1979-1989)



    Research:
C with Classes
   ARM C++
The Classic Age
          (1989-1999)



   Mainstream:
    Wide usage
standardization
The Dark Age
                               (1999-2009)



Coffee-based languages domination:
         Productivity over Efficiency
              People over Hardware
Let’s compare them all
                       Efficiency          Flexibility         Abstraction   Productivity
C
Efficient high-level          +                   +               Non-goal      Non-goal
portable code

C++
C + efficient                 +                   +                 +           Non-goal
abstraction

Java/C#
Productivity           At the expence of   At the expense of        +              +
Perception


     Performance
     & Control     Productivity
Reality


          Performance   Productivity
          & Control
C++ Values
   Never compromise on performance and control.
       Efficient abstraction (e.g., inlining by default)
       Flexibility to express exactly what you need (e.g., specialization)
       Exact control over memory layout (e.g., stack/member allocation)
       Determinism and ordering WYSIWYG (e.g., stack/member lifetime)
   Deeply believe in trust and zero overhead.
       “Leave no room for a language lower than C++” other than asm
       “Zero overhead” / “Don’t pay for what you don’t use”
       “Trust the programmer” (  pitfalls! still give usability, guard rails)
       “Always provide a way to open the hood and get down to the metal”
Priorities
   C++ says:
     “Provide default-on guard rails and programmer productivity too,
      but never at the expense of performance and control.”


   Coffee-based languages say:
     “Provide performance and control too, but never at the expense
      of always-on guard rails and programmer productivity.”
Why C++
is popular
again?
Change drivers
Mobile
Cloud/Datacenter
Platform shifts
Mobile
Power
Hardware limitations
Complex user experience
Vendor’s point of view




 1st version          N/A                Java         .NET
2nd version    Objective-C, C, C++   Java, C, C++   .NET, C++
Datacenter/Cloud
Power consumption

           57% Hardware +
           31% Power = 88%
           of expenses are directly
           dependent on efficiency
Platform shifts
The Renaissance
             (2009-2019)



Return of the King:
            C++11
 Productivity tools
Developer survey
    Q: How long has your current application been in development?   (N=387)
C++11
   Corollary: Lots of what people “know” about C++ is no longer true.
   Changes to coding style/idioms/guidance.
     That’s why it feels new. Style/idioms/guidance define a language.

       Features that significantly change style/idioms/guidance include:
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );
    return s;
}

int main() {
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );
                                                            always there: scoped lifetimes
    return s;
                                                           by construction (stack, member)
}
                                                               strongly exception-safe
int main() {
    vector<future<string>> v;                                       deterministic
    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );
    return s;
}

int main() {
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );                               asynchrony
    return s;
}                                                           201x’s best friend
int main() {
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );                                     lambdas
    return s;
}                                                           invasion of the functionals
int main() {                                                capture by ref or by value
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );
    return s;
}

int main() {
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );
    return s;
}

int main() {
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
                                                                              move semantics
    reverse( begin(s), end(s) );                                                      =
    return s;                                                            the semantics of value types
}                                                                      (no pointers! declared lifetime!)
int main() {
                                                                                      +
    vector<future<string>> v;                   // <-- look ma, no *     the efficiency of reference
                                                                         types (no deep copying!)
    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();
    }
}
Taste of C++11
string flip( string s ) {
    reverse( begin(s), end(s) );
    return s;
}

int main() {
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();                    Hello, Lang.NEXT!
    }
}
Taste of C++11
string flip( string s ) {
                                                                   program is guaranteed to
    reverse( begin(s), end(s) );
                                                                   allocate only three strings
    return translate_to_french( move(s) );
}
                                                                   high compute / low latency

int main() {
    vector<future<string>> v;

    v.push_back( async([]{ return flip(" ,olleH"); }) );
    v.push_back( async([]{ return flip( ".gnaL"); }) );
    v.push_back( async([]{ return flip("n!TXEN"); }) );

    for( auto& e : v ) {
        cout << e.get();              Bonjour, Langue.SUIVANTE!
    }
}
Summary
   Modern C++ is clean, safe, and fast.
       Strong abstraction: Type-safe OO and generic code for modeling power, without
        sacrificing control and efficiency.
       Full control over code and memory: You can always express what you want to do. You
        can always control memory and data layout exactly.
       Pay-as-you-go efficiency: No mandatory overheads.

“The going word at Facebook is that ‘reasonably written C++ code just runs fast,’
   which underscores the enormous effort spent at optimizing PHP and Java code.
Paradoxically, C++ code is more difficult to write than in other languages, but efficient
                    code is a lot easier.” – Andrei Alexandrescu
The Future
          (2019-????)



Here be dragons:
   End of Moore
Moore’s law
Reality
Register at
academy.eleks.com
before February 15


And may the Force
be with you!
Got a question?
      Ask!

Mais conteúdo relacionado

Mais procurados

Mais procurados (15)

Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commands
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
C++ TUTORIAL 1
C++ TUTORIAL 1C++ TUTORIAL 1
C++ TUTORIAL 1
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignment
 
C programms
C programmsC programms
C programms
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
C++ TUTORIAL 5
C++ TUTORIAL 5C++ TUTORIAL 5
C++ TUTORIAL 5
 
C++ TUTORIAL 4
C++ TUTORIAL 4C++ TUTORIAL 4
C++ TUTORIAL 4
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programs
 
C++ TUTORIAL 10
C++ TUTORIAL 10C++ TUTORIAL 10
C++ TUTORIAL 10
 
C++ TUTORIAL 9
C++ TUTORIAL 9C++ TUTORIAL 9
C++ TUTORIAL 9
 
Programa en C++ ( escriba 3 números y diga cual es el mayor))
Programa en C++ ( escriba 3 números y diga cual es el mayor))Programa en C++ ( escriba 3 números y diga cual es el mayor))
Programa en C++ ( escriba 3 números y diga cual es el mayor))
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
 
Asynchronní programování
Asynchronní programováníAsynchronní programování
Asynchronní programování
 

Semelhante a The Renaissance of C

Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]Abhishek Sinha
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonAlex Payne
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
 
Swift - One step forward from Obj-C
Swift -  One step forward from Obj-CSwift -  One step forward from Obj-C
Swift - One step forward from Obj-CNissan Tsafrir
 
Function in c program
Function in c programFunction in c program
Function in c programumesh patil
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloadingkinan keshkeh
 
An Introduction to Property Based Testing
An Introduction to Property Based TestingAn Introduction to Property Based Testing
An Introduction to Property Based TestingC4Media
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat SheetHortonworks
 
Groovify your java code by hervé roussel
Groovify your java code by hervé rousselGroovify your java code by hervé roussel
Groovify your java code by hervé rousselHervé Vũ Roussel
 
How to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ CodeHow to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ CodeMicrosoft Tech Community
 
How to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ CodeHow to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ CodeMicrosoft Tech Community
 
Language Language Models (in 2023) - OpenAI
Language Language Models (in 2023) - OpenAILanguage Language Models (in 2023) - OpenAI
Language Language Models (in 2023) - OpenAISamuelButler15
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right timeDavide Cerbo
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
 
Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Sergey Platonov
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6Nitay Neeman
 

Semelhante a The Renaissance of C (20)

Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Effective Object Oriented Design in Cpp
Effective Object Oriented Design in CppEffective Object Oriented Design in Cpp
Effective Object Oriented Design in Cpp
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duo
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
CppTutorial.ppt
CppTutorial.pptCppTutorial.ppt
CppTutorial.ppt
 
Swift - One step forward from Obj-C
Swift -  One step forward from Obj-CSwift -  One step forward from Obj-C
Swift - One step forward from Obj-C
 
Function in c program
Function in c programFunction in c program
Function in c program
 
mobl
moblmobl
mobl
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
An Introduction to Property Based Testing
An Introduction to Property Based TestingAn Introduction to Property Based Testing
An Introduction to Property Based Testing
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat Sheet
 
Groovify your java code by hervé roussel
Groovify your java code by hervé rousselGroovify your java code by hervé roussel
Groovify your java code by hervé roussel
 
How to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ CodeHow to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ Code
 
How to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ CodeHow to Adopt Modern C++17 into Your C++ Code
How to Adopt Modern C++17 into Your C++ Code
 
Language Language Models (in 2023) - OpenAI
Language Language Models (in 2023) - OpenAILanguage Language Models (in 2023) - OpenAI
Language Language Models (in 2023) - OpenAI
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right time
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
 
Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
 

Mais de Victor Haydin

IoT: future that has already happened
IoT: future that has already happenedIoT: future that has already happened
IoT: future that has already happenedVictor Haydin
 
Marketing by nerds: how R&D actually works
Marketing by nerds: how R&D actually worksMarketing by nerds: how R&D actually works
Marketing by nerds: how R&D actually worksVictor Haydin
 
How to write your database: the story about Event Store
How to write your database: the story about Event StoreHow to write your database: the story about Event Store
How to write your database: the story about Event StoreVictor Haydin
 
Not Only Java [JDay Lviv 2013]
Not Only Java [JDay Lviv 2013]Not Only Java [JDay Lviv 2013]
Not Only Java [JDay Lviv 2013]Victor Haydin
 
Fast & Furious: building HPC solutions in a nutshell
Fast & Furious: building HPC solutions in a nutshellFast & Furious: building HPC solutions in a nutshell
Fast & Furious: building HPC solutions in a nutshellVictor Haydin
 
Concurrency: how to shoot yourself in both feet. Simultaneously.
Concurrency: how to shoot yourself in both feet. Simultaneously.Concurrency: how to shoot yourself in both feet. Simultaneously.
Concurrency: how to shoot yourself in both feet. Simultaneously.Victor Haydin
 
Hadoop: the Big Answer to the Big Question of the Big Data
Hadoop: the Big Answer to the Big Question of the Big DataHadoop: the Big Answer to the Big Question of the Big Data
Hadoop: the Big Answer to the Big Question of the Big DataVictor Haydin
 
Cloud Computing in a Nutshell
Cloud Computing in a NutshellCloud Computing in a Nutshell
Cloud Computing in a NutshellVictor Haydin
 
Distributed vcs basics + hg
Distributed vcs basics + hgDistributed vcs basics + hg
Distributed vcs basics + hgVictor Haydin
 
Web Development: Yesterday, Today, Tomorrow
Web Development: Yesterday, Today, TomorrowWeb Development: Yesterday, Today, Tomorrow
Web Development: Yesterday, Today, TomorrowVictor Haydin
 
ASP.Net Core Services
ASP.Net Core ServicesASP.Net Core Services
ASP.Net Core ServicesVictor Haydin
 

Mais de Victor Haydin (12)

IoT: future that has already happened
IoT: future that has already happenedIoT: future that has already happened
IoT: future that has already happened
 
Marketing by nerds: how R&D actually works
Marketing by nerds: how R&D actually worksMarketing by nerds: how R&D actually works
Marketing by nerds: how R&D actually works
 
How to write your database: the story about Event Store
How to write your database: the story about Event StoreHow to write your database: the story about Event Store
How to write your database: the story about Event Store
 
Not Only Java [JDay Lviv 2013]
Not Only Java [JDay Lviv 2013]Not Only Java [JDay Lviv 2013]
Not Only Java [JDay Lviv 2013]
 
Fast & Furious: building HPC solutions in a nutshell
Fast & Furious: building HPC solutions in a nutshellFast & Furious: building HPC solutions in a nutshell
Fast & Furious: building HPC solutions in a nutshell
 
Concurrency: how to shoot yourself in both feet. Simultaneously.
Concurrency: how to shoot yourself in both feet. Simultaneously.Concurrency: how to shoot yourself in both feet. Simultaneously.
Concurrency: how to shoot yourself in both feet. Simultaneously.
 
Hadoop: the Big Answer to the Big Question of the Big Data
Hadoop: the Big Answer to the Big Question of the Big DataHadoop: the Big Answer to the Big Question of the Big Data
Hadoop: the Big Answer to the Big Question of the Big Data
 
Cloud Computing in a Nutshell
Cloud Computing in a NutshellCloud Computing in a Nutshell
Cloud Computing in a Nutshell
 
Databases in .NET
Databases in .NETDatabases in .NET
Databases in .NET
 
Distributed vcs basics + hg
Distributed vcs basics + hgDistributed vcs basics + hg
Distributed vcs basics + hg
 
Web Development: Yesterday, Today, Tomorrow
Web Development: Yesterday, Today, TomorrowWeb Development: Yesterday, Today, Tomorrow
Web Development: Yesterday, Today, Tomorrow
 
ASP.Net Core Services
ASP.Net Core ServicesASP.Net Core Services
ASP.Net Core Services
 

The Renaissance of C

  • 1. The Renaissance of C++ by Victor Haydin, Head of R&D Office, ELEKS
  • 2. Agenda A bit of C++ history Why C++ is popular again? The future of C++
  • 3. Quick Survey What programming languages do you know?
  • 4. A bit of C++ history
  • 5. The Prehistoric Age (1979-1989) Research: C with Classes ARM C++
  • 6. The Classic Age (1989-1999) Mainstream: Wide usage standardization
  • 7. The Dark Age (1999-2009) Coffee-based languages domination: Productivity over Efficiency People over Hardware
  • 8. Let’s compare them all Efficiency Flexibility Abstraction Productivity C Efficient high-level + + Non-goal Non-goal portable code C++ C + efficient + + + Non-goal abstraction Java/C# Productivity At the expence of At the expense of + +
  • 9. Perception Performance & Control Productivity
  • 10. Reality Performance Productivity & Control
  • 11. C++ Values  Never compromise on performance and control.  Efficient abstraction (e.g., inlining by default)  Flexibility to express exactly what you need (e.g., specialization)  Exact control over memory layout (e.g., stack/member allocation)  Determinism and ordering WYSIWYG (e.g., stack/member lifetime)  Deeply believe in trust and zero overhead.  “Leave no room for a language lower than C++” other than asm  “Zero overhead” / “Don’t pay for what you don’t use”  “Trust the programmer” (  pitfalls! still give usability, guard rails)  “Always provide a way to open the hood and get down to the metal”
  • 12. Priorities  C++ says: “Provide default-on guard rails and programmer productivity too, but never at the expense of performance and control.”  Coffee-based languages say: “Provide performance and control too, but never at the expense of always-on guard rails and programmer productivity.”
  • 16. Power
  • 19. Vendor’s point of view 1st version N/A Java .NET 2nd version Objective-C, C, C++ Java, C, C++ .NET, C++
  • 21. Power consumption 57% Hardware + 31% Power = 88% of expenses are directly dependent on efficiency
  • 23. The Renaissance (2009-2019) Return of the King: C++11 Productivity tools
  • 24. Developer survey Q: How long has your current application been in development? (N=387)
  • 25. C++11  Corollary: Lots of what people “know” about C++ is no longer true.  Changes to coding style/idioms/guidance.  That’s why it feels new. Style/idioms/guidance define a language.  Features that significantly change style/idioms/guidance include:
  • 26. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); return s; } int main() { vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 27. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); always there: scoped lifetimes return s; by construction (stack, member) }  strongly exception-safe int main() { vector<future<string>> v;  deterministic v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 28. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); return s; } int main() { vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 29. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); asynchrony return s; }  201x’s best friend int main() { vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 30. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); lambdas return s; }  invasion of the functionals int main() {  capture by ref or by value vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 31. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); return s; } int main() { vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 32. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); return s; } int main() { vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 33. Taste of C++11 string flip( string s ) { move semantics reverse( begin(s), end(s) ); = return s;  the semantics of value types } (no pointers! declared lifetime!) int main() { + vector<future<string>> v; // <-- look ma, no *  the efficiency of reference types (no deep copying!) v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); } }
  • 34. Taste of C++11 string flip( string s ) { reverse( begin(s), end(s) ); return s; } int main() { vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); Hello, Lang.NEXT! } }
  • 35. Taste of C++11 string flip( string s ) {  program is guaranteed to reverse( begin(s), end(s) ); allocate only three strings return translate_to_french( move(s) ); }  high compute / low latency int main() { vector<future<string>> v; v.push_back( async([]{ return flip(" ,olleH"); }) ); v.push_back( async([]{ return flip( ".gnaL"); }) ); v.push_back( async([]{ return flip("n!TXEN"); }) ); for( auto& e : v ) { cout << e.get(); Bonjour, Langue.SUIVANTE! } }
  • 36. Summary  Modern C++ is clean, safe, and fast.  Strong abstraction: Type-safe OO and generic code for modeling power, without sacrificing control and efficiency.  Full control over code and memory: You can always express what you want to do. You can always control memory and data layout exactly.  Pay-as-you-go efficiency: No mandatory overheads. “The going word at Facebook is that ‘reasonably written C++ code just runs fast,’ which underscores the enormous effort spent at optimizing PHP and Java code. Paradoxically, C++ code is more difficult to write than in other languages, but efficient code is a lot easier.” – Andrei Alexandrescu
  • 37. The Future (2019-????) Here be dragons: End of Moore
  • 40. Register at academy.eleks.com before February 15 And may the Force be with you!