-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsequences.tex
50 lines (45 loc) · 1.12 KB
/
consequences.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
\begin{frame}
\begin{block}{Consequences}
A commitment to Functional Programming has many immediate consequences.
\end{block}
\end{frame}
\begin{frame}[fragile]
\begin{block}{For example, no more mutable data structures}
\begin{lstlisting}[style=java]
class Person {
`var` name: String
`var` address: Address
}
\end{lstlisting}
\end{block}
\end{frame}
\begin{frame}[fragile]
\begin{block}{No more loops}
\begin{lstlisting}[style=java]
for(int i = 0; i < list.length; `i++`)
\end{lstlisting}
\end{block}
\end{frame}
\begin{frame}[fragile]
\begin{block}{No reading \& writing files arbitrarily}
\begin{lstlisting}[style=java]
contents1 = readFile("filename");
writeFile("filename", "the contents");
contents2 = readFile("filename");
\end{lstlisting}
\end{block}
\end{frame}
\begin{frame}
\begin{block}{So then, if all our familiar tools are taken away \ldots}
\emph{how do we then achieve these practical outcomes?}
\end{block}
\end{frame}
\begin{frame}
\begin{block}{?}
\begin{itemize}
\item how do we design our data structures?
\item how do we write loops?
\item how do we read \& write files?
\end{itemize}
\end{block}
\end{frame}