Modern C++
Programming
1. Introduction
Federico Busato
2025-01-30
Table of Contents
1 A Little History of C/C++ Programming Language
2 Areas of Application and Popularity
3 C++ Philosophy
4 C++ Weaknesses
C++ Alternatives
Why Switching to a New Language is Hard?
5 The Course
1/55
About Motivation 1/5
“When recruiting research assistants, I look at grades as the last indi-
cator. I find that imagination, ambition, initiative, curiosity, drive,
are far better predictors of someone who will do useful work with me. Of
course, these characteristics are themselves correlated with high grades,
but there is something to be said about a student who decides that a
given course is a waste of time and that he works on a side project in-
stead.
Breakthroughs don’t happen in regular scheduled classes, they happen
in side projects. We want p eople who complete the work they were as-
signed, but we also need people who can reflect critically on what
is genuinely important"
Daniel Lemire, Prof. at the University of Quebec
2/55
About Motivation 2/5
Academic excellence is not a strong predictor
of career excellence
“Across industries, research shows that the correlation between grades
and job performance is modest in the first year after college and trivial
within a handful of years...
Academic grades rarely assess qualities like creativity, leadership and team-
work skills, or social, emotional and political intelligence. Yes, straight-A
students master cramming information and regurgitating it on exams.
But career success is rarely about finding the right solution to a
problem it’s more about finding the right problem to solve...
3/55
About Motivation 3/5
“Getting straight A’s requires conformity. Having an influential
career demands originality.
This might explain why Steve Jobs finished high school with a 2.65
G.P.A., J.K. Rowling graduated from the University of Exeter with
roughly a C average, and the Rev. Dr. Martin Luther King Jr. got only
one A in his four years at Morehouse
If your goal is to graduate without a blemish on your transcript, you
end up taking easier classes and staying within your comfort zone. If
you’re willing to tolerate the occasional B...You gain experience coping
with failures and setbacks, which builds resilience
4/55
About Motivation 4/5
“Straight-A students also miss out socially. More time studying in
the library means less time to start lifelong friendships, join new clubs or
volunteer...Looking back, I don’t wish my grades had been higher. If I
could do it over again, I’d study less”
Adam Grant, the New York Times
www.nytimes.com/2018/12/08/opinion/college-gpa-career-success.html
5/55
About Motivation 5/5
“Got a 2.4 GPA my first semester in college. Thought maybe I wasn’t
cut out for engineering. Today I’ve landing two spacecraft on Mars, and
designing one for the moon.
STEM is hard for everyone. Grades ultimately aren’t what matters.
Curiosity and persistence matter
Ben Cichy, Chief Software Engineer,
NASA Mars Science Laboratory
twitter.com/bencichy/status/1197752802929364992?s=20
6/55
About Programming 1/2
“And programming computers was so fascinating. You create your
own little universe, and then it does what you tell it to do”
Vint Cerf, TCP/IP co-inventor and Turing Award
“Most good programmers do programming not because they expect to
get paid or get adulation by the public, but because it is fun to program”
Linus Torvalds, principal developer of the Linux kernel
“You might not think that programmers are artists, but programming
is an extremely creative profession. It’s logic-based creativity”
John Romero, co-founder of id Software
7/55
About Programming 2/2
Creativity Programming is extremely creative. The ability to p erceive the problem in
a novel way, provide new and original solutions. Creativity allows
recognizing and generating alternatives
Form of Art Art is the expression of human creative skills. Every programmer has his
own style. Codes and algorithms show elegance and beauty in the same
way as painting or music
Learn Programming gives the opportunity to learn new things every day,
improve own skills and knowledge
Challenge Programming is a challenge. A challenge against yourself, the problem,
and the environment
8/55
Knowledge-Experience Relation
9/55
Learning and Thinking
“In software development, learning is not a big part of the job.
It is the job."
Woody Zuill
“Programming is not about typing, it’s about thinking."
Rich Hickey
10/55
A Little History of
C/C++
Programming
Language
The Assembly Programming Language
A long time ago, in a galaxy far,
far away....there was Assembly
Extremely simple instructions
Requires lots of code to do simple tasks
Can express anything your computer can do
Hard to read, write
...redundant, boring programming, bugs pro-
liferation
main:
.Lfunc_begin0:
push rbp
.Lcfi0:
.Lcfi1:
mov rbp, rsp
.Lcfi2:
sub rsp, 16
movabs rdi, .L.str
.Ltmp0:
mov al, 0
call printf
xor ecx, ecx
mov dword ptr [rbp - 4], eax
mov eax, ecx
add rsp, 16
pop rbp
ret
.Ltmp1:
.Lfunc_end0:
.L.str:
.asciz
"Hello World\n"
11/55
A Little History of C 1/3
In the 1969 Dennis M. Ritchie and Ken Thompson (AT&T, Bell Labs) worked on
developing an operating system for a large computer that could be used by a thousand
users. The new operating system was called UNIX
The whole system was still written in assembly code. Besides assembler and Fortran,
UNIX also had an interpreter for the programming language B. A high-level language
like B made it possible to write many pages of code task in just a few lines of code. In
this way the code could be produced much faster than in assembly
A drawback of the B language was that it did not know data-types
(everything was
expressed in machine words). Another functionality that the B language did not provide
was the use of “structures”. The lack of these things formed the reason for Dennis
M. Ritchie to develop the programming language C. In 1988 they delivered the final
standard definition ANSI C
12/55
A Little History of C 2/3
Dennis M. Ritchie and Ken Thompson
#include "stdio.h"
int main() {
printf(
"Hello World\n");
}
13/55
A Little History of C 3/3
Areas of Application:
UNIX operating system
Computer games
Due to their power and ease of use, C were used in the programming of the
special effects for Star Wars
Star Wars - The Empire Strikes Back
14/55
A Little History of C++ 1/3
The C++ programming language (originally named “C with Classes") was devised
by Bjarne Stroustrup also an employee from Bell Labs (AT&T). Stroustrup started
working on C with Classes in 1979. (The ++ is C language operator)
The first commercial release of the C++ language was in October 1985
15/55
A Little History of C++ 2/3
The roots of C++
The Evolution of C++Past, Present, and Future”, B. Stroustrup, CppCon16
16/55
A Little History of C++ 3/3
17/55
About Evolution
“If you’re teaching today what you were teaching five
years ago, either the field is dead or you are”
Noam Chomsky
18/55
Areas of Application
and Popularity
Most Popular Programming Languages
(IEEE Spectrum - 2024)
Interactive: The Top Programming Languages 2024
19/55
Most Popular Programming Languages (TIOBE - October. 2024)
www.tiobe.com/tiobe-index/
20/55