updated
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 05 Aug 2019 20:14:06 +0100
changeset 269 86a85865e772
parent 268 e43f7e92ba26
child 270 b9eaa5cdec4a
updated
handouts/pep-ho.pdf
handouts/pep-ho.tex
Binary file handouts/pep-ho.pdf has changed
--- a/handouts/pep-ho.tex	Thu Aug 01 09:48:34 2019 +0100
+++ b/handouts/pep-ho.tex	Mon Aug 05 20:14:06 2019 +0100
@@ -93,12 +93,12 @@
 
 I found a convenient IDE for writing Scala programs is Microsoft's
 \textit{Visual Studio Code} (VS Code) which runs under MacOSX, Linux and
-obviously Windows.\footnote{unlike \emph{Microsoft Visual Studio}---note
+obviously Windows.\footnote{\ldots{}unlike \emph{Microsoft Visual Studio}---note
 the minuscule difference in the name---which is a heavy-duty,
-Windows-only IDE\ldots{}jeez, with all their money could they not come
+Windows-only IDE\ldots{}jeez, with all their money could they not have come
 up with a completely different name for a complete different project?
 For the pedantic, Microsoft Visual Studio is an IDE, whereas Visual
-Studio Code is considered as a source code editor. Anybody knows the what the
+Studio Code is considered to be a \emph{source code editor}. Anybody knows what the
 difference is?} It can be downloaded for free from
 
 \begin{quote}
@@ -146,7 +146,7 @@
 But you should be careful if you use them for your coursework: they
 are meant to play around, not really for serious work. 
 
-Scala can be used with the heavy-duty IDEs Eclipse and IntelliJ.
+As one might expect, Scala can be used with the heavy-duty IDEs Eclipse and IntelliJ.
 A ready-made Scala bundle for Eclipse is available from
 
 \begin{quote}
@@ -157,9 +157,9 @@
 Also IntelliJ includes plugins for Scala. \underline{\textbf{BUT}}, 
 I do \textbf{not} recommend the usage of either Eclipse or IntelliJ for PEP: these IDEs
 seem to make your life harder, rather than easier, for the small
-programs we will write in this module. They are really meant to be used
-when you have a million-lines codebase, rather than our
-``toy-programs'' we will write in PEP\ldots{}for example why on earth am I required to create a
+programs that we will write in this module. They are really meant to be used
+when you have a million-lines codebase than with our small
+``toy-programs''\ldots{}for example why on earth am I required to create a
 completely new project with several subdirectories when I just want to
 try out 20-lines of Scala code? Your mileage may vary though. ;o)
 
@@ -167,15 +167,17 @@
 
 Before we go on, let me explain a bit more why we want to inflict upon
 you another programming language. You hopefully have mastered Java and
-C++\ldots{}the world should be your oyster, no? Well, it is not that
-easy. We do require Scala in PEP, but actually we do not religiously
-care whether you learn Scala---after all it is just a programming
-language (albeit a nifty one IMHO). What we do care about is that you
-learn about \textit{functional programming}. Scala is just the vehicle
-for that. Still, you need to learn Scala well enough to get good marks
-in PEP, but functional programming could equally be taught with Haskell,
-F\#, SML, Ocaml, Kotlin, Clojure, Scheme, Elm and many other functional
-programming languages. %Your friendly lecturer just happens to like Scala
+C++\ldots{}the world should be your oyster, no? Well, this is not as
+simple as one might wish. We do require Scala in PEP, but actually we
+do not religiously care whether you learn Scala---after all it is just
+a programming language (albeit a nifty one IMHO). What we do care
+about is that you learn about \textit{functional programming}. Scala
+is just the vehicle for that. Still, you need to learn Scala well
+enough to get good marks in PEP, but functional programming could
+equally be taught with Haskell, F\#, SML, Ocaml, Kotlin, Clojure,
+Scheme, Elm and many other functional programming languages.
+%Your
+%friendly lecturer just happens to like Scala
 %and the Department agreed that it is a good idea to inflict Scala upon
 %you.
 
@@ -188,11 +190,12 @@
 some form of \emph{state} in your program and you continuously change this
 state by issuing some commands---for example for updating a field in an
 array or for adding one to a variable and so on. The classic
-example for this style of programming are \texttt{for}-loops in C:
+example for this style of programming is \texttt{for}-loops in C/C++. Consider
+the snippet:
 
 \begin{lstlisting}[language=C,numbers=none]
 for (int i = 10; i < 20; i++) { 
-      //...Do something interesting with i...
+      //...do something with i...
 }
 \end{lstlisting}
 
@@ -202,7 +205,7 @@
 exits. When this code is compiled and actually runs, there will be some
 dedicated space reserved for \texttt{i} in memory. This space of
 typically 32 bits contains \texttt{i}'s current value\ldots\texttt{10}
-at the beginning, and then the content will be overwritten with some
+at the beginning, and then the content will be overwritten with 
 new content in every iteration. The main point here is that this kind of
 updating, or manipulating, memory is 25.806\ldots or \textbf{THE ROOT OF
 ALL EVIL}!!