SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
C++ by Choice
Florentin Picioroaga
IDS GmbH, Ettlingen, Germany
filo.rom@gmail.com
February 24, 2016
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 1 / 18
Overview
1 Motivation
2 Why C++?
Popularity
General features
Static vs. Dynamic type system
Supports many paradigms
3 When C++?
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 2 / 18
Motivation
Why C++, when there are so many programming languages?
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 3 / 18
Motivation
Why C++, when there are so many programming languages?
When C++? What is the best match (application, programming
language = C++)?
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 3 / 18
Motivation
Why C++, when there are so many programming languages?
When C++? What is the best match (application, programming
language = C++)?
Not in the scope:
Why not C++?
When not C++?
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 3 / 18
Popularity
Popularity is ,,the fact that something or someone is liked, enjoyed, or supported by
many people” (Cambridge)
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 4 / 18
Popularity
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 5 / 18
Popularity
Why is C++ popular?
Compatibility with C, no. 1 or 2 in the last 20 years:
source code compatibility
object code compatibility
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 6 / 18
General features
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
General features
General-purpose undo mechanism with destructors
Undo for: memory, mutexes, opening files
RAII, implemented in C++ with constructors/destructors
Guaranteed to be executed even when an exception occurs, only for the
objects on the stack
Deterministic finalization in contrast with GC systems
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
General features
General-purpose undo mechanism with destructors
Undo for: memory, mutexes, opening files
RAII, implemented in C++ with constructors/destructors
Guaranteed to be executed even when an exception occurs, only for the
objects on the stack
Deterministic finalization in contrast with GC systems
templates
generic programming (STL)
TMP (Template Meta-Programming)
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
General features
General-purpose undo mechanism with destructors
Undo for: memory, mutexes, opening files
RAII, implemented in C++ with constructors/destructors
Guaranteed to be executed even when an exception occurs, only for the
objects on the stack
Deterministic finalization in contrast with GC systems
templates
generic programming (STL)
TMP (Template Meta-Programming)
overloading
function objects, the basis of lambdas in C++11
smart pointers
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
Static vs. Dynamic type system
from formal logic we have two properties we can use to describe any
evaluation procedure: soundness and completeness
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 8 / 18
Static vs. Dynamic type system
from formal logic we have two properties we can use to describe any
evaluation procedure: soundness and completeness
a sound type system is one that rejects all erroneous programs, and a
complete system accepts all correct programs
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 8 / 18
Static vs. Dynamic type system
a programming language with a complete and unsound (static) type
system has a fallback in the form of dynamic typing
dynamically typed means that types are attached to values at run time
statically typed means that types are checked at compile time, and a
program that does not have a static type is rejected by the compiler
combined power of both type systems:
Mozilla Firefox: a core of statically-typed C++, with dynamically-typed
JavaScript running the user interface
many large video games, e.g. World of WarCraft: C++ and Lua
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 9 / 18
Static vs. Dynamic type system
is static or dynamic typing more convenient?
auto func = [] (int x) {
if (x >= 0) return 2*x;
return "negative number";
};
std::cout << func(2) << func(-1);
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 10 / 18
Static vs. Dynamic type system
is static or dynamic typing more convenient?
auto func = [] (int x) {
if (x >= 0) return 2*x;
return "negative number";
};
std::cout << func(2) << func(-1);
More convenient to write code in a dynamic language but more
convenient to maintain a set of assumptions that cannot be violated
about certain types.
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 10 / 18
Static vs. Dynamic type system
is static or dynamic typing more convenient?
auto func = [] (int x) {
if (x >= 0) return 2*x;
return "negative number";
};
std::cout << func(2) << func(-1);
More convenient to write code in a dynamic language but more
convenient to maintain a set of assumptions that cannot be violated
about certain types.
does static typing prevent useful programs?
array t = { (1, 1), (true, true)}
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 10 / 18
Static vs. Dynamic type system
is static typings early bug-detection important?
static typing catches bugs earlier, when the code is statically checked,
compiled.
bugs are easier to fix if discovered sooner, while the developer is still
thinking about the code
the programmer can rely on the compiler and focus atention elsewhere
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 11 / 18
Static vs. Dynamic type system
does static or dynamic typing lead to better performance?
type tags do not exist at runtime, they take more space and slow down
constructors
faster code since it does not need to perform type tests at run time
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 12 / 18
Static vs. Dynamic type system
does static or dynamic typing lead to better performance?
type tags do not exist at runtime, they take more space and slow down
constructors
faster code since it does not need to perform type tests at run time
but if programmers in statically typed languages have to work around
type-system limitations, then those workarounds can erode the
supposed performance advantages
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 12 / 18
Static vs. Dynamic type system
is static or dynamic typing better for prototyping?
dynamic typing is often considered better for prototyping, no need to
define the types of variables, functions, and data structures when those
decisions are in flux
some part of the program would not type-check in a statically typed
language, but the rest of the program can run (e.g., to test the parts
you just wrote)
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 13 / 18
Static vs. Dynamic type system
is static or dynamic typing better for code evolution?
dynamic typing is sometimes more convenient for code evolution
because we can change code to be more permissive (accept arguments
of more types) without having to change any of the pre-existing clients
of the code.
f(x) = return 2 * x
static type-checking is very useful when evolving code to catch bugs
that the evolution introduces. When we change the type of a function,
all callers no longer type-check, which means the typechecker gives us
a ,,to-do list” of all the call-sites that need to change
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 14 / 18
Supports many paradigms
procedural programming (functions and data separately)
free functions not belonging to any class
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
Supports many paradigms
procedural programming (functions and data separately)
free functions not belonging to any class
OOP (functions + data grouped in classes)
multiple inheritance
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
Supports many paradigms
procedural programming (functions and data separately)
free functions not belonging to any class
OOP (functions + data grouped in classes)
multiple inheritance
Generic programming
algorithms running for any data type
algorithms run as fast as an algorithm tuned for a specific type
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
Supports many paradigms
procedural programming (functions and data separately)
free functions not belonging to any class
OOP (functions + data grouped in classes)
multiple inheritance
Generic programming
algorithms running for any data type
algorithms run as fast as an algorithm tuned for a specific type
functional programming
closures with imutable data
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
Supports many paradigms
procedural programming (functions and data separately)
free functions not belonging to any class
OOP (functions + data grouped in classes)
multiple inheritance
Generic programming
algorithms running for any data type
algorithms run as fast as an algorithm tuned for a specific type
functional programming
closures with imutable data
,,unsafe” programming
,,Trust the programmer”, the rational for C language.
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
When C++
Best suited for system applications:
must meet a constraint
really fast (simulation, computer generation of images)
minimal power
data layout
drivers
communication protocols, working with legacy systems
program size
static (including RTL)
dynamic (image and working set size)
efficient communication with outside entities
Hardware
OSes
code in other languages (C)
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 16 / 18
References
Scott Meyers (2014)
Why C++ Sails When the Vasa Sank
Moscow C++ Party.
Dan Grossman (2015)
Programming Languages
University of Washington.
Ben Karel (2009)
Sound and Complete
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 17 / 18
Hope you enjoyed!
Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 18 / 18

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET FrameworkKamlesh Makvana
 
Python Programming | Star Certification
Python  Programming | Star CertificationPython  Programming | Star Certification
Python Programming | Star CertificationStar Certification
 
Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpAbefo
 
The .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewThe .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewCarlos Lopes
 
How to Review your Translation with 2 Free and Open Source QA Tools
How to Review your Translation with 2 Free and Open Source QA ToolsHow to Review your Translation with 2 Free and Open Source QA Tools
How to Review your Translation with 2 Free and Open Source QA ToolsQabiria
 
C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0Buu Nguyen
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharpHEM Sothon
 
MTaulty_DevWeek_VS2010
MTaulty_DevWeek_VS2010MTaulty_DevWeek_VS2010
MTaulty_DevWeek_VS2010ukdpe
 
Introduction to OmegaT
Introduction to OmegaTIntroduction to OmegaT
Introduction to OmegaTQabiria
 

Was ist angesagt? (14)

Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Safety criticalc++
Safety criticalc++Safety criticalc++
Safety criticalc++
 
Visualisualisation of Semantic Relations, Tim Stein, SMWCon Fall 2014
Visualisualisation of Semantic Relations, Tim Stein, SMWCon Fall 2014Visualisualisation of Semantic Relations, Tim Stein, SMWCon Fall 2014
Visualisualisation of Semantic Relations, Tim Stein, SMWCon Fall 2014
 
Python Programming | Star Certification
Python  Programming | Star CertificationPython  Programming | Star Certification
Python Programming | Star Certification
 
Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharp
 
Python Online From EasyLearning Guru
Python Online From EasyLearning GuruPython Online From EasyLearning Guru
Python Online From EasyLearning Guru
 
The .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewThe .NET Platform - A Brief Overview
The .NET Platform - A Brief Overview
 
How to Review your Translation with 2 Free and Open Source QA Tools
How to Review your Translation with 2 Free and Open Source QA ToolsHow to Review your Translation with 2 Free and Open Source QA Tools
How to Review your Translation with 2 Free and Open Source QA Tools
 
Introduction to programming using c
Introduction to programming using cIntroduction to programming using c
Introduction to programming using c
 
C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0
 
Part 1
Part 1Part 1
Part 1
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
MTaulty_DevWeek_VS2010
MTaulty_DevWeek_VS2010MTaulty_DevWeek_VS2010
MTaulty_DevWeek_VS2010
 
Introduction to OmegaT
Introduction to OmegaTIntroduction to OmegaT
Introduction to OmegaT
 

Andere mochten auch

Veysel delen portfolyo fuar
Veysel delen portfolyo fuarVeysel delen portfolyo fuar
Veysel delen portfolyo fuarveysel delen
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Ovidiu Farauanu
 
GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」
GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」
GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」Taisuke Inoue
 
Aporte individual unidad ii_ carolina_ sanchez
Aporte individual unidad ii_ carolina_ sanchezAporte individual unidad ii_ carolina_ sanchez
Aporte individual unidad ii_ carolina_ sanchezcorazon31
 
Turismo cusqueño.ppt
Turismo cusqueño.pptTurismo cusqueño.ppt
Turismo cusqueño.pptelubi
 
Power points tic
Power points ticPower points tic
Power points ticLucas Lopez
 

Andere mochten auch (15)

Access2007 lab1
Access2007 lab1Access2007 lab1
Access2007 lab1
 
Sicurweb 7.4
Sicurweb 7.4Sicurweb 7.4
Sicurweb 7.4
 
Vegan research
Vegan researchVegan research
Vegan research
 
Veysel delen portfolyo fuar
Veysel delen portfolyo fuarVeysel delen portfolyo fuar
Veysel delen portfolyo fuar
 
Prez
PrezPrez
Prez
 
лекції
лекціїлекції
лекції
 
л п №4
л п №4л п №4
л п №4
 
лп11
лп11лп11
лп11
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
 
GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」
GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」
GitLab Meetup Tokyo #1 LT:「わりと大きい会社でGitLabをホスティングしてみた話」
 
Powtoon
PowtoonPowtoon
Powtoon
 
Aporte individual unidad ii_ carolina_ sanchez
Aporte individual unidad ii_ carolina_ sanchezAporte individual unidad ii_ carolina_ sanchez
Aporte individual unidad ii_ carolina_ sanchez
 
Turismo cusqueño.ppt
Turismo cusqueño.pptTurismo cusqueño.ppt
Turismo cusqueño.ppt
 
Power points tic
Power points ticPower points tic
Power points tic
 
Estudio de audiencia Santiago TV
Estudio de audiencia Santiago TVEstudio de audiencia Santiago TV
Estudio de audiencia Santiago TV
 

Ähnlich wie Florentin Picioroaga - C++ by choice

Ali alshehri c++_comparison between c++&amp;python
Ali alshehri c++_comparison between c++&amp;pythonAli alshehri c++_comparison between c++&amp;python
Ali alshehri c++_comparison between c++&amp;pythonAliAAAlshehri
 
Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...
Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...
Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...Maksim Shudrak
 
Grokking Techtalk #38: Escape Analysis in Go compiler
 Grokking Techtalk #38: Escape Analysis in Go compiler Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking Techtalk #38: Escape Analysis in Go compilerGrokking VN
 
Software Security - Static Analysis Tools
Software Security - Static Analysis ToolsSoftware Security - Static Analysis Tools
Software Security - Static Analysis ToolsEmanuela Boroș
 
Optimization of the build times using Conan
Optimization of the build times using ConanOptimization of the build times using Conan
Optimization of the build times using ConanOvidiu Farauanu
 
intro.pptx (1).pdf
intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdfANIKULSAIKH
 
PVS-Studio, a solution for developers of modern resource-intensive applications
PVS-Studio, a solution for developers of modern resource-intensive applicationsPVS-Studio, a solution for developers of modern resource-intensive applications
PVS-Studio, a solution for developers of modern resource-intensive applicationsPVS-Studio
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfVisionAcademyProfSac
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docMayurWagh46
 
Tech Days 2015: AdaCore Directions
Tech Days 2015: AdaCore DirectionsTech Days 2015: AdaCore Directions
Tech Days 2015: AdaCore DirectionsAdaCore
 
Enforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automationEnforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automationDanilo Pianini
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoPeter Bittner
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming LanguageR.h. Himel
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxNEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJmeharikiros2
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 

Ähnlich wie Florentin Picioroaga - C++ by choice (20)

Ali alshehri c++_comparison between c++&amp;python
Ali alshehri c++_comparison between c++&amp;pythonAli alshehri c++_comparison between c++&amp;python
Ali alshehri c++_comparison between c++&amp;python
 
Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...
Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...
Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to ligh...
 
Grokking Techtalk #38: Escape Analysis in Go compiler
 Grokking Techtalk #38: Escape Analysis in Go compiler Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking Techtalk #38: Escape Analysis in Go compiler
 
Software Security - Static Analysis Tools
Software Security - Static Analysis ToolsSoftware Security - Static Analysis Tools
Software Security - Static Analysis Tools
 
Optimization of the build times using Conan
Optimization of the build times using ConanOptimization of the build times using Conan
Optimization of the build times using Conan
 
Session 1 - c++ intro
Session   1 - c++ introSession   1 - c++ intro
Session 1 - c++ intro
 
intro.pptx (1).pdf
intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdf
 
PVS-Studio, a solution for developers of modern resource-intensive applications
PVS-Studio, a solution for developers of modern resource-intensive applicationsPVS-Studio, a solution for developers of modern resource-intensive applications
PVS-Studio, a solution for developers of modern resource-intensive applications
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdf
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).doc
 
Tech Days 2015: AdaCore Directions
Tech Days 2015: AdaCore DirectionsTech Days 2015: AdaCore Directions
Tech Days 2015: AdaCore Directions
 
Enforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automationEnforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automation
 
TiConf EU 2014
TiConf EU 2014TiConf EU 2014
TiConf EU 2014
 
Introduction python
Introduction pythonIntroduction python
Introduction python
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon Otto
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 

Mehr von Ovidiu Farauanu

Back in Business with C++
Back in Business with C++Back in Business with C++
Back in Business with C++Ovidiu Farauanu
 
Distributed Cache, bridging C++ to new technologies (Hazelcast)
Distributed Cache, bridging C++ to new technologies (Hazelcast)Distributed Cache, bridging C++ to new technologies (Hazelcast)
Distributed Cache, bridging C++ to new technologies (Hazelcast)Ovidiu Farauanu
 
Monadic Computations in C++14
Monadic Computations in C++14Monadic Computations in C++14
Monadic Computations in C++14Ovidiu Farauanu
 
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)Ovidiu Farauanu
 
Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Ovidiu Farauanu
 

Mehr von Ovidiu Farauanu (7)

Back in Business with C++
Back in Business with C++Back in Business with C++
Back in Business with C++
 
Interface Oxidation
Interface OxidationInterface Oxidation
Interface Oxidation
 
Bind me if you can
Bind me if you canBind me if you can
Bind me if you can
 
Distributed Cache, bridging C++ to new technologies (Hazelcast)
Distributed Cache, bridging C++ to new technologies (Hazelcast)Distributed Cache, bridging C++ to new technologies (Hazelcast)
Distributed Cache, bridging C++ to new technologies (Hazelcast)
 
Monadic Computations in C++14
Monadic Computations in C++14Monadic Computations in C++14
Monadic Computations in C++14
 
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
High Order Function Computations in c++14 (C++ Dev Meetup Iasi)
 
Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)
 

Kürzlich hochgeladen

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Kürzlich hochgeladen (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Florentin Picioroaga - C++ by choice

  • 1. C++ by Choice Florentin Picioroaga IDS GmbH, Ettlingen, Germany filo.rom@gmail.com February 24, 2016 Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 1 / 18
  • 2. Overview 1 Motivation 2 Why C++? Popularity General features Static vs. Dynamic type system Supports many paradigms 3 When C++? Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 2 / 18
  • 3. Motivation Why C++, when there are so many programming languages? Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 3 / 18
  • 4. Motivation Why C++, when there are so many programming languages? When C++? What is the best match (application, programming language = C++)? Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 3 / 18
  • 5. Motivation Why C++, when there are so many programming languages? When C++? What is the best match (application, programming language = C++)? Not in the scope: Why not C++? When not C++? Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 3 / 18
  • 6. Popularity Popularity is ,,the fact that something or someone is liked, enjoyed, or supported by many people” (Cambridge) Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 4 / 18
  • 7. Popularity Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 5 / 18
  • 8. Popularity Why is C++ popular? Compatibility with C, no. 1 or 2 in the last 20 years: source code compatibility object code compatibility Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 6 / 18
  • 9. General features Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
  • 10. General features General-purpose undo mechanism with destructors Undo for: memory, mutexes, opening files RAII, implemented in C++ with constructors/destructors Guaranteed to be executed even when an exception occurs, only for the objects on the stack Deterministic finalization in contrast with GC systems Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
  • 11. General features General-purpose undo mechanism with destructors Undo for: memory, mutexes, opening files RAII, implemented in C++ with constructors/destructors Guaranteed to be executed even when an exception occurs, only for the objects on the stack Deterministic finalization in contrast with GC systems templates generic programming (STL) TMP (Template Meta-Programming) Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
  • 12. General features General-purpose undo mechanism with destructors Undo for: memory, mutexes, opening files RAII, implemented in C++ with constructors/destructors Guaranteed to be executed even when an exception occurs, only for the objects on the stack Deterministic finalization in contrast with GC systems templates generic programming (STL) TMP (Template Meta-Programming) overloading function objects, the basis of lambdas in C++11 smart pointers Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 7 / 18
  • 13. Static vs. Dynamic type system from formal logic we have two properties we can use to describe any evaluation procedure: soundness and completeness Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 8 / 18
  • 14. Static vs. Dynamic type system from formal logic we have two properties we can use to describe any evaluation procedure: soundness and completeness a sound type system is one that rejects all erroneous programs, and a complete system accepts all correct programs Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 8 / 18
  • 15. Static vs. Dynamic type system a programming language with a complete and unsound (static) type system has a fallback in the form of dynamic typing dynamically typed means that types are attached to values at run time statically typed means that types are checked at compile time, and a program that does not have a static type is rejected by the compiler combined power of both type systems: Mozilla Firefox: a core of statically-typed C++, with dynamically-typed JavaScript running the user interface many large video games, e.g. World of WarCraft: C++ and Lua Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 9 / 18
  • 16. Static vs. Dynamic type system is static or dynamic typing more convenient? auto func = [] (int x) { if (x >= 0) return 2*x; return "negative number"; }; std::cout << func(2) << func(-1); Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 10 / 18
  • 17. Static vs. Dynamic type system is static or dynamic typing more convenient? auto func = [] (int x) { if (x >= 0) return 2*x; return "negative number"; }; std::cout << func(2) << func(-1); More convenient to write code in a dynamic language but more convenient to maintain a set of assumptions that cannot be violated about certain types. Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 10 / 18
  • 18. Static vs. Dynamic type system is static or dynamic typing more convenient? auto func = [] (int x) { if (x >= 0) return 2*x; return "negative number"; }; std::cout << func(2) << func(-1); More convenient to write code in a dynamic language but more convenient to maintain a set of assumptions that cannot be violated about certain types. does static typing prevent useful programs? array t = { (1, 1), (true, true)} Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 10 / 18
  • 19. Static vs. Dynamic type system is static typings early bug-detection important? static typing catches bugs earlier, when the code is statically checked, compiled. bugs are easier to fix if discovered sooner, while the developer is still thinking about the code the programmer can rely on the compiler and focus atention elsewhere Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 11 / 18
  • 20. Static vs. Dynamic type system does static or dynamic typing lead to better performance? type tags do not exist at runtime, they take more space and slow down constructors faster code since it does not need to perform type tests at run time Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 12 / 18
  • 21. Static vs. Dynamic type system does static or dynamic typing lead to better performance? type tags do not exist at runtime, they take more space and slow down constructors faster code since it does not need to perform type tests at run time but if programmers in statically typed languages have to work around type-system limitations, then those workarounds can erode the supposed performance advantages Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 12 / 18
  • 22. Static vs. Dynamic type system is static or dynamic typing better for prototyping? dynamic typing is often considered better for prototyping, no need to define the types of variables, functions, and data structures when those decisions are in flux some part of the program would not type-check in a statically typed language, but the rest of the program can run (e.g., to test the parts you just wrote) Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 13 / 18
  • 23. Static vs. Dynamic type system is static or dynamic typing better for code evolution? dynamic typing is sometimes more convenient for code evolution because we can change code to be more permissive (accept arguments of more types) without having to change any of the pre-existing clients of the code. f(x) = return 2 * x static type-checking is very useful when evolving code to catch bugs that the evolution introduces. When we change the type of a function, all callers no longer type-check, which means the typechecker gives us a ,,to-do list” of all the call-sites that need to change Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 14 / 18
  • 24. Supports many paradigms procedural programming (functions and data separately) free functions not belonging to any class Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
  • 25. Supports many paradigms procedural programming (functions and data separately) free functions not belonging to any class OOP (functions + data grouped in classes) multiple inheritance Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
  • 26. Supports many paradigms procedural programming (functions and data separately) free functions not belonging to any class OOP (functions + data grouped in classes) multiple inheritance Generic programming algorithms running for any data type algorithms run as fast as an algorithm tuned for a specific type Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
  • 27. Supports many paradigms procedural programming (functions and data separately) free functions not belonging to any class OOP (functions + data grouped in classes) multiple inheritance Generic programming algorithms running for any data type algorithms run as fast as an algorithm tuned for a specific type functional programming closures with imutable data Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
  • 28. Supports many paradigms procedural programming (functions and data separately) free functions not belonging to any class OOP (functions + data grouped in classes) multiple inheritance Generic programming algorithms running for any data type algorithms run as fast as an algorithm tuned for a specific type functional programming closures with imutable data ,,unsafe” programming ,,Trust the programmer”, the rational for C language. Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 15 / 18
  • 29. When C++ Best suited for system applications: must meet a constraint really fast (simulation, computer generation of images) minimal power data layout drivers communication protocols, working with legacy systems program size static (including RTL) dynamic (image and working set size) efficient communication with outside entities Hardware OSes code in other languages (C) Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 16 / 18
  • 30. References Scott Meyers (2014) Why C++ Sails When the Vasa Sank Moscow C++ Party. Dan Grossman (2015) Programming Languages University of Washington. Ben Karel (2009) Sound and Complete Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 17 / 18
  • 31. Hope you enjoyed! Florentin Picioroaga (IDS GmbH) C++ by Choice February 24, 2016 18 / 18