
273: Off the Topic of My Jammies
Chris and Elecia chat with each other about the new year. All is fine until she starts quizzing him about some language details of his new project.
Many object-oriented resources suggest using composition (has-a) over inheritance (is-a-type-of) (wiki). Where do swift extensions fit in? It seems to me (Elecia here) that extension is invisible composition that allows adding of functions.
For example, say you want a TiltSensor and you already have an ImuSensor object so you need to add a function for TiltComputation.
You could make the TiltSensor contain an ImuSensor (composition). You call the…
The skinny
The skinny isn't ready yet — notes appear once the transcript is processed.