Jan 24
Standard beginning : any questions about anything so far?
Today's main topic : review of the art of programming ...
Please do interrupt and/or put your thoughts in anywhere along the way.
class nuts'n'bolts
First : expectations :
'welcome to my classroom' - Rob Jenkins, chronicle of higher ed (Essentially I expect you to act like responsible adults.)
Our mechanism for turning in homework is through this website.
I'll do a demo for folks who haven't worked with me before.
Email or other methods are OK ... but more work for me.
Dylan (dylanm@marlboro.edu) is the CS tutor this term.
Tutoring will be Monday evenings and by appointment.
You can also email me (mahoney@marlboro.edu) with questions or setup times to work individually as needed.
This term's homework policy :
- in before class, day due: 1 point
- in after that (and after discussed), before next class: 0.75 points
- up to two weeks after that: 0.5 points
- more than two weeks late: 0.25 points
Semester grade is
- homework (on a scale based on points)
- midterm project
- final project
Projects will be graded on
- correctness
- understanding demonstrated
- clarity of presentation & docs (including tests)
coding Q & A
Python - a quick tour and/or review
- running a program
- variables and scope
- collections : lists, dictionaries
- functions
- loops and conditionals
- classes
- comments, docstrings, doctests
- style conventions
Python gotchas :
Good practice (at least, according to Jim)
- variable names?
- comments?
- API docs?
- tests?
How do you go about coding something?
- top down?
- bottom up?
- style:
- imperative?
- functional?
- objects?
- other?
- What references do you have close to hand?
- What tools do you prefer? (editor, version control, command line, ...)
homework for Thursday
textbook readings
Any questions from the reading?
The text I think is pretty good but has some issues:
- Their code is *not* particularly well documented in general. In particular, they often don't have clear docstrings with input & output specs.
- They tend to give little snips of code scattered through their prose, without a final "here's everything" file.
Be aware that they're using python 3. You can use python 2 or python 3 as you choose ... but do be clear which you're running.
coding assignment
What & why :
First, the Fraction class (an "object") is an example of an implementation of a "data structure", i.e. something with
- data within it (in this case, two numbers)
- an API (which just means well defined ways to interact with it; in this case, a way to create one, show it, and add two of them)
Second, we're reviewing coding practice.
And third, it's a chance to draw a graph of something
graph example
There are many software tools to draw plots of points and curves : if you're already used to one (from some other course or your own past experience), then you're welcome to use that.
If you don't have one on hand, I suggest the Jupyter numerical python environment. Here's an example, which I will discuss:
This thing has lots of other bells and whistles and is used by lots of folks doing cool numerical stuff:
_Now_ we're having fun ...
practice
Discussion / in class coding practice:
depending on time
Start talking about material in the next chapter:
- analysis of algorithms
- O() notation (i.e. "Big O notation")
- how long it takes: wallclock time & number of steps
- typical time | memory tradeoffs
- average, worst-case, and other considerations