Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret committed Jan 11, 2021
1 parent 8aa8e36 commit 68bb549
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions latex/code/patterns/structural/adapter.py
Expand Up @@ -15,11 +15,11 @@ def training(...) # <-- this method should be called train
class ModelAdapter(OurMLModel): # <-- implements our interface
def __init__(self, model: TheirMLModel):
self._model = model # <-- our adapter holds the foreign model

def train(...): # <-- and defines a different interface for it
self._model.training(...)


# Their model with our interface:
model = ModelAdapter(TheirMLModel(...))
model = ModelAdapter(TheirMLModel(...)) # (actually need TheirConcreteMLModel)

12 changes: 6 additions & 6 deletions latex/input/patterns/careful.tex
Expand Up @@ -10,12 +10,12 @@ \section{Discussion}
\end{quote}
}
\begin{itemize}[<+->]
\item \hhl{Example}: If functions are first-level objects \srem{(can be passed around like normal datatypes)}, I do not need to define a strategy class hierarchy. \\
\item \hhl{Example}: If functions are first-level objects \srem{(can be passed around like normal datatypes)}, I do not \srem{(always)} need to define a strategy class hierarchy. \\
However, this could still be considered the same \enquote{pattern} \srem{(only with a simpler implementation)}
\item The \enquote{Patterns} give you \hhl{vocabulary} to describe your problem in an abstract way, even if the implementation details very a lot between languages
\item Lots of pattern boilerplate should make you think about your design and language choices
\item Be aware that the implementation of \srem{(or even the need for)} certain patterns can be very dependent on your language features
\end{itemize}
\item Be aware that the implementation of \srem{(or even the need for)} certain patterns can be very dependent on your language features
\end{itemize}
\end{frame}

\begin{frame}{Common criticism}
Expand All @@ -27,12 +27,12 @@ \section{Discussion}
%
\begin{itemize}[<+->]
%
\item
\item
Remember the zen of python: simple is better than complex; but complex is better than complicated
%
\item
Do not introduce complexity \srem{(use the design pattern)} if you do not fully understand why you need it.
\item
Do not introduce complexity \srem{(use the design pattern)} if you do not fully understand why you need it.
\item
Some people highlight the KISS \srem{(\underline keep \underline it \underline simple, \underline stupid)} and YAGNI \srem{(\underline you \underline aren't \underline gonna \underline need \underline it)} principle
\end{itemize}
\end{frame}
Expand Down
Binary file modified timing.ods
Binary file not shown.

0 comments on commit 68bb549

Please sign in to comment.