# HG changeset patch # User Santosh G. Vattam # Date 1254813263 -19800 # Node ID ecf0f0e885f48e188191200c568c952c23788325 # Parent c72eae1c5c9d16b55afb7db36e2cefca0ce8da8f Updated Coding Style slides. diff -r c72eae1c5c9d -r ecf0f0e885f4 day1/Session-3.tex --- a/day1/Session-3.tex Tue Oct 06 02:10:07 2009 +0530 +++ b/day1/Session-3.tex Tue Oct 06 12:44:23 2009 +0530 @@ -374,4 +374,49 @@ Functions (and others) are first-class objects. Can be passed to and returned from functions. \inctime{10} \end{frame} + +\subsection{Coding Style in Python} +\begin{frame}{Readability and Consistency} + \begin{itemize} + \item Readability Counts!-Code is read more often than its written. + \item Consistency! + \item Know when to be inconsistent. + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Code Layout} + \begin{itemize} + \item Indentation + \item Tabs or Spaces?? + \item Maximum Line Length + \item Blank Lines + \item Encodings + \end{itemize} +\end{frame} + +\begin{frame}{Whitespaces in Expressions} + \begin{itemize} + \item When to use extraneous whitespaces?? + \item When to avoid extra whitespaces?? + \item Use one statement per line + \end{itemize} +\end{frame} + +\begin{frame}{Comments} + \begin{itemize} + \item No comments better than contradicting comments + \item Block comments + \item Inline comments + \end{itemize} +\end{frame} + +\begin{frame}{Docstrings} + \begin{itemize} + \item When to write docstrings? + \item Ending the docstrings + \item One liner docstrings + \end{itemize} +\end{frame} +\inctime{10} \end{document}