-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC++17_flash_introduction.tex
261 lines (251 loc) · 11.1 KB
/
C++17_flash_introduction.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
\documentclass[usenames,dvipsnames,svgnames,14pt]{beamer}
\usepackage[english]{babel}
\usepackage{fontspec,fontawesome,mathabx,fp,pgfornament}
\usepackage{TeXnicalities}
\setsansfont{Yanone Kaffeesatz}[
UprightFont = *-Regular ,
BoldFont = *-Bold ,
BoldItalicFont = *-Bold ,
BoldSlantedFont = *-Bold ,
ItalicFont = *-Light ,
SlantedFont = *-Light ,
SmallCapsFont = *-Thin
]
\graphicspath{{Figures/}}
\mode<presentation>
{
\usetheme{Z02}
\setbeamersize{text margin left=8mm, text margin left=8mm}
}
\usetikzlibrary{
positioning,
shapes,
}
\input{ListingsSetup}
%Commands for this presentation
\defbeamertemplate{description item}{bold label}{\textbf{\insertdescriptionitem}}
\makeatletter
\newcommand*{\overlaynumber}{\number\beamer@slideinframe}
\newlength{\textsize}
\setlength{\textsize}{\f@size pt}
\newcommand{\emoji}[1]{\;\raisebox{-0.15\textsize}{\includegraphics[height=\f@size pt]{#1}}}
\makeatother
\newcommand{\then}{\raisebox{2pt}{$\;\drsh\;$}}
\newcommand{\Then}[1]{%
\pgfmathwidth{"\then"}
\pgfmathparse{\linewidth-\pgfmathresult}
\then\parbox[t]{\pgfmathresult pt}{\raggedright #1}
}
\newcommand{\MakeCoverSlide}{%
\begin{frame}[plain,noframenumbering]
\begin{tikzpicture}[remember picture, overlay]
\usebeamercolor{title page background canvas}
\fill[bg] (current page.south west) rectangle (current page.north east);
\node[text depth=0.5ex, anchor=north] (title) at ($(current page.north)-(0mm,8mm)$)
{\huge\usebeamercolor[fg]{title}\inserttitle};
\node[below = 3mm of title] (photo)
{%
\raisebox{-0.5\height}{\includegraphics[height=0.33\textheight]{C++_Logo}}%
\hspace{6mm}\raisebox{-0.5\height}{\usebeamercolor[fg]{title}\fontsize{60}{72}\selectfont 17}
};
\node[below = 5mm of photo] (author) {\large\insertauthor};
\node[below = 3mm of author] (date) {\usebeamerfont{date}\insertdate};
\node[anchor=south, outer sep=0mm, font=\footnotesize] at (current page.south) {
\includegraphics[width=10mm]{CC-BY}\quad
\raisebox{1pt}{\color{PB}\href{https://github.com/AxelKrypton}{\faGithub\ AxelKrypton}}
};
\node[anchor=south west] at (current page.south west) {
\includegraphics[width=20mm]{LogoGoethe}
};
\node[anchor=south east] at (current page.south east) {
\includegraphics[width=20mm]{LogoCRC}
};
\end{tikzpicture}
\end{frame}
}
\AtBeginPart{%
\begin{frame}
\partpage
\end{frame}
}
%\AtBeginSection{%
% \begin{frame}
% \sectionpage
% \end{frame}
%}
\begin{document}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\title{A flashy introduction to}
\author{Alessandro~Sciarra}
\date{14 April 2023}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\MakeCoverSlide
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\begin{frame}{My main expertise for the CRC-TR\,211}{\{\,in terms of programming languages\,\}}
\begin{tikzpicture}[every node/.style={circle, very thick, draw}, node distance=2mm]
\node[PS, minimum size=30mm, visible on=<1>] (bash) {Bash};
\node[PP, minimum size=27mm, right = of bash, alt=<1>{fill=none}{fill=PB!10, fill on=<2>}] (cpp) {C++};
\begin{scope}[scope on=<1>]
\node[PT, minimum size=23mm, right = of cpp, yshift=11.5mm] (latex) {LaTeX};
\node[PB, minimum size=23mm, right = of latex] (git) {Git};
\node[PQ, minimum size=15mm, below = of $(latex.south)!0.5!(git.south)$ ] (python) {Python};
\end{scope}
\node[PB, draw=none, right = of cpp, visible on=<2>, text width=3cm, align=center]{Today we want to explore some modern features!};
\end{tikzpicture}
\begin{varblock}{alert}[0.9\textwidth]{Let's have a chat}
Clean code as common aspect orthogonal to any language!\\
Come and torture me with all your nagging questions!
\end{varblock}
\end{frame}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\begin{frame}[fragile]{Kick-off riddle: Does this code compile?}{\uncover<2->{An (ab)use of the language}}
\begin{columns}
\begin{column}{0.58\textwidth}
\begin{varblock}{}[\textwidth]{}
\begin{Cpp}
#include |+<iostream>+|
int main() {
|=https://github.com/AxelKrypton=|
int x = 42;
std::cout << x << '\n';
}
\end{Cpp}
\begin{uncoverenv}<2->
\begin{Bash}[numbers=none]
42
\end{Bash}
\end{uncoverenv}
\end{varblock}
\end{column}
\begin{column}{0.42\textwidth}
\centering
\includegraphics[width=\columnwidth]{WIITY}
\end{column}
\end{columns}
\vspace{3mm}
\begin{uncoverenv}<2->
\begin{center}
\Large
\URL[PB]{https://godbolt.org/z/Y6Yb7M79T}{~Yes, it does!} But why?\\[5mm]
\footnotesize
\uncover<3>{
\emoji{Sunglasses}\;
Because \;\texttt{https:}\; is a \;\CPP|goto|\; label and the rest of the line a comment! \emoji{Sunglasses}
}
\end{center}
\end{uncoverenv}
\end{frame}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\begin{frame}{C++ standards: A simplistic overview}
\begin{description}[<+(1)->][C++23XX]
\item[C++98] First standardization\quad
\PB{C++03} Some polishing
\item[C++11] \alert{Turning point}\\
\Then{
\small
Move semantics, \CPP|auto|, lambdas, \CPP|constexpr|,\\
smart pointers, type-traits, variadic templates, etc.
}
\item[C++14] Small improvements\\
\Then{
\small
Better lambdas and better \CPP|constexpr|,\\
return type deduction, variable templates, etc.
}
\item[C++17] \PS{Larger improvements $\;\to\;$ this talk!}
\item[C++20] \alert{Turning point}\\
\Then{\small Concepts, modules, coroutines, ranges, etc.}
\item[C++23] Small improvements\\
\Then{
\small
Explicit object parameter (deducing \CPP|this|),\\
\CPP|std::mdspan|, \CPP|std::expected|, \CPP|std::print|, etc.
}
\end{description}
\end{frame}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\begin{frame}{Is C++ growing more and more?}{How should I be supposed to learn it?}
\begin{uncoverenv}<2>
\begin{center}
\includegraphics[width=0.9\textwidth]{Toolkit}\\[1mm]
Think of it as a toolkit, you aren't always gonna need everything!
\end{center}
\end{uncoverenv}
\end{frame}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\begin{frame}{Disclaimer}
\vspace{-3mm}
\centering
\begin{center}
\hyperlink{P1}{\PB{\large Part 1:} New language features}\\[3mm]
\hyperlink{P2}{\PB{\large Part 2:} New library features}
\end{center}
\begin{varblock}{alert}{That's not all the folks!}
I just took the main topics which I think it might be interesting to start with and I will either give you a taste of them or simply point you to some reference!
\end{varblock}
\bigskip
\URL[PS]{https://en.cppreference.com/w/cpp/17}{Cppreference of C++17 standard}\\[3mm]
\URL[PT]{https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf}{Free draft version, 1608 pages}
\end{frame}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\label{P1}
\part{New language features}
\input{New_language_features}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\label{P2}
\part{New library features}
\input{New_library_features}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\part{Your next C++ years}
\begin{frame}{\uncover<2->{Which is the best way to go, now?}}
\begin{onlyenv}<1>
\begin{tikzpicture}[remember picture, overlay]
\node at (current page.center) {
\includegraphics[width=0.88\textwidth]{LearnCpp}
};
\end{tikzpicture}
\end{onlyenv}
\vspace{5mm}
\begin{overlayarea}{\textwidth}{0.23\textheight}
\begin{onlyenv}<2>
\begin{itemize}
\item Consider exploring new features
\item Take a decision in your codebase/team
\item There are better and better way to write the same code!
\end{itemize}
\end{onlyenv}
\begin{onlyenv}<3>
\begin{center}
\LARGE Thank you! Questions?
\end{center}
\end{onlyenv}
\end{overlayarea}
\begin{uncoverenv}<2->
\begin{center}
\begin{tikzpicture}[every node/.style={inner sep=0pt}, pgfornamentstyle/.style={color=PS}]
\def\ornsize{11mm}
\node[font=\large, text=PB](Text) {%
\begin{tabular}{c}
Every day, work to refine the skills you have\\
and to add new tools to your repertoire.\\[1mm]
{\normalsize---~The pragmatic programmer~---}
\end{tabular}
};
\node[shift={(-12mm,6mm)},anchor=north west] (CNW)
at (Text.north west) {\pgfornament[width=\ornsize]{61}};
\node[shift={(12mm,6mm)},anchor=north east] (CNE)
at (Text.north east) {\pgfornament[width=\ornsize,symmetry=v]{61}};
\node[shift={(-12mm,-5mm)},anchor=south west] (CSW)
at (Text.south west) {\pgfornament[width=\ornsize,symmetry=h]{61}};
\node[shift={(12mm,-5mm)},anchor=south east] (CSE)
at (Text.south east) {\pgfornament[width=\ornsize,symmetry=c]{61}};
\pgfornamentline{CNW.north east}{CNE.north west}{3}{88}
\pgfornamentline{CSW.south east}{CSE.south west}{3}{88}
\pgfornamentline{CNW.south west}{CSW.north west}{2}{88}
\pgfornamentline{CNE.south east}{CSE.north east}{2}{88}
\end{tikzpicture}
\end{center}
\end{uncoverenv}
\end{frame}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
\end{document}