Week 10: No. No, no. I clean.

Hi there, I’m back and this week was a lot of cleaning up to do. We made the Vertical Slice work for the upcoming title, I think a week ago. In order to do this in time, we needed to use as much code as possible that was already there without spending time on cleaning it up. This created some spaghetti code and this week I basically did a lot of cleaning up of my own code. It meant that I needed to rethink the responsiblities of each class that I used. Sometimes I forgot something or didn’t quite get what the intention of a class was and I was lucky to have Sybren with me who was familiar with those particular classes and he was always quick to correct me. I learned a lot during this process.

In particular about thinking about the whole picture of what I’m writing my code on;

  • So yea MY code works, but what about the methods I’m using in a lot of the other classes, are they actually the methods or classes that I need to use? Do they need restructuring or renaming? Are other methods in the class even used anymore?
  • So the code WORKS but is it easy to read? Does it make sense for these methods to be in this class? Does the class name still make sense and isn’t it doing things outside it’s scope?

It felt good to clean stuff up. It made the code easier to follow.

I felt a bit like Consuela from Family Guy during this week ๐Ÿ˜€

Leave a Reply