day2/session4.tex
branchscipy2010
changeset 434 99e1af343b04
parent 433 af45c8da1d5d
child 435 2aed1dda7909
equal deleted inserted replaced
433:af45c8da1d5d 434:99e1af343b04
   285   \begin{itemize}
   285   \begin{itemize}
   286         \item When to use extraneous whitespaces?
   286         \item When to use extraneous whitespaces?
   287         \item When to avoid extra whitespaces?
   287         \item When to avoid extra whitespaces?
   288         \item Use one statement per line
   288         \item Use one statement per line
   289    \end{itemize}
   289    \end{itemize}
       
   290 \end{frame}
       
   291 
       
   292 \begin{frame}[fragile]
       
   293  \frametitle{Whitespace}
       
   294  Whitespace... it's not just for compilers!
       
   295   \begin{lstlisting}
       
   296 
       
   297 def myfanfunc(somevar,another,yetmore):
       
   298     if a%b==0:return b
       
   299     return myfanfunc(b,a%b)
       
   300       
       
   301   \end{lstlisting}
       
   302 \end{frame}
       
   303 
       
   304 \begin{frame}[fragile]
       
   305  \frametitle{Whitespace}
       
   306  The compiler doesn't care!  Humans do!
       
   307   \begin{lstlisting}
       
   308 
       
   309 def my_fan_func(some_var, another, yet_more):
       
   310     if a % b == 0:
       
   311         return b
       
   312     return my_fan_func(b, a % b)
       
   313       
       
   314   \end{lstlisting}
   290 \end{frame}
   315 \end{frame}
   291 
   316 
   292 \begin{frame}{Comments}
   317 \begin{frame}{Comments}
   293   \begin{itemize}
   318   \begin{itemize}
   294         \item No comments better than contradicting comments
   319         \item No comments better than contradicting comments