How do I use object oriented programming in a useful way?
We'll see some examples this week; next class, we'll learn the syntax for defining objects in Python and practice writing programs with objects in them.
How are objects useful and how do they change how we've been doing programming?
You already know an example of how objects are useful! When we worked with the graphics library, each object we used helped us make the program simpler and more readable. Consider how much more work we would have done if, instead of having a Rectangle object (which remembered its own data like its corner points and color), we had to organize that data in our own code!
In the example reverse
function we wrote, why doesn't the empty return happen after (not before) all of the new letters are added?
This is one of the key insights to understanding recursion: the base case is the stack frame that returns first, even though that stack frame was added last. Try running the code on pythontutor, or tracing the stack yourself on a small example, to see what order the function calls (and returns) get added to (and removed from) the stack.
"I'm still struggling to take the leap of faith when it comes to recursion."
I hear you. Get started on this week's lab early, and take full advantage of your lab session, the ninja sessions, asking questions on Piazza, and attending office hours!
It takes practice to become accustomed to thinking about recursion. The "leap of faith" starts as a real leap of faith, but the more you practice, the more the pattern of recursion will make sense to you.