Lesson 6
Dealing with Sequences of Objects
Chapter 1: Introduction
Recap
Are we ready for more programming?
Let me summarise what we have covered over the past five lessons.
In Lesson 1, you gained a big picture appreciation of what programming really is. The main message from this lesson is that you should not jump straight into coding, at least not before you really understand the problem and have a clear solution in your head or on paper first!
In Lessons 2 to 4, you explored the basic ‘building blocks’ in much more detail, and applied your knowledge to solve various programming problems.
In Lesson 5, you started tidying up your programs by refactoring your code to be modular (reusable) and highly abstractive (self-explanatory). You looked at how functions can be used to achieve this, and refactored some of your previous code, including your robot project. Hopefully all your future programs will be reusable and self-explanatory from now on, as you start writing bigger and more complex programs!
We have talked a lot about good coding style, guided by your favourite (or dreaded!) PEP 8. In Lesson 5, we discussed the style recommendations for writing functions, as well as documenting your functions with docstrings.
I also discussed writing automated test codes with a ‘test-first’ approach to implementing programs, and introduced the assert
statement which can be useful for writing test cases. So, remember to always incrementally test-as-you-code!
We have also introduced you to the concept of Git branches in the previous lesson to add to your git knowledge. While you are unlikely to be using git branches for this course itself, you may find it useful in some other courses or if you work collaboratively in the future. This knowledge is also useful for this lesson (a sneak preview: we will be revisiting git checkout for a different purpose!)