nov 22
coding notes
- functions
- clear inputs / outputs
- tests
- smaller is better
- don't rely on lots of global variables: hard to test, hard to maintain
- documentation
- don't paraphrase the code
- do describe inputs and outputs in doc string
- common python conventions
def some_function(a=2, b=3):
"""Prints out some stuff and returns True.
Longer description here, after a blank line.
Always triple quote the doc string.
Be sure to describe what the inputs are if they aren't clear
Keyword Arguments:
a -- size in inches (default 2)
b -- width in feet (default 3)
"""
# code starts here
misc python goodies
- sequence functions
- filter(func, seq)
- map(func, seq)
- reduce(func, seq)
- see 5.1.3 in python tutorial
cheese shop
to do
- cs accounts for alec and si
- go over making a clickable application from python