Thread 1, Day 4 - Monday, October 23, 2023
Agenda
- Discussion: Don't Repeat Yourself
- How to keep your code tidy.
- Capitalization conventions when authoring Swift code.
- Vocabulary review.
- Reviewing various solutions to the exercise from yesterday's class.
TipHere is code that exemplifies the idea of embedding one structure inside another, and here is a screenshot comparing that code to the cards themselves.
- Portfolio: Sharing Long Blocks of Code
- Share code, not screenshots of code.
- Please continue to use screenshots to show the results of code being run.
- Portfolio: Handling Comments on Posts
- Do not mark comments as resolved in Notion so that the record of our conversation is preserved and easy to see at a glance.
- Concept: Computed Properties
- Structures can do more than just store values - they can calculate values as well.
TipHere is the code we developed and discussed in class, and here is a screenshot showing the results when the code is run.
- Exercise: Describing 2D and 3D Figures
- You have been randomly assigned a 2D or 3D figure to work with.
- Create a new Xcode playground named Computed Properties Exercise.
- Write a structure that models the figure you have been assigned.
- The structure should use stored properties and computed properties.
- Make several instances of the structure and test your work.