It’s 9pm and I’m leaving MA only now because during the last two hours I was coding playing Pictionary with co-Makers.

IMG_2906

Today’s lectures were about:

  • Inheritance and composition. Both allow coders not to repeat themselves (a core principle of coding) when creating objects which share the same characteristics. Inheritance applies when we are dealing with several objects of the same “family” (or class). Composition is for objects of different classes (I will write more about objects and classes in a future post).

The major part of my day was spent splitting hairs with Ana (my current pair-programming partner).

This week, we are trying to re-create the system that manages Boris bikes. In this project, among different objects, we have vans which can collect broken bikes from docking stations and can also drop them off to garages for repair. For a while, we tried to figure out whether a van knew that it should go to a garage after collecting broken bikes or not. If it doesn’t, how can we know that the van won’t just hang around after collecting the broken bikes and chat some minis instead of doing its job and go to the garage to drop off these damn bikes?

It may look silly but that’s actually the sort of questions we have to ask ourselves continuously in order to write the test cases used in TDD. In this precise case, it turned out that we were trying to make things more complex than necessary.

Thus, it was not a very productive day due to all these *useless* digressions, but it taught me an lesson: when it comes to coding, better keep things simple whenever possible.

I also learned the following words: buttercup, thumb twiddling,  and chatterbox, all thanks to the amazing drawing skills of my co-Makers.