3.12 rspec and more oop

7.5 + 2.5 Today we covered a lot of ground at Launch. We started off working on instance variables, getter and setter methods, and attr_reader / writer / accessors. It’s interesting how object variables are available outside of the object by default in js, and not in ruby. I was also surprised to hear that object methods are not hidden in ruby. That feels odd to me. It’s easy enough to fix though – putting ‘private’ before a method will make it and every other method below it private.

After lunch we learned about oop concepts like encapsulation, decomposition, and the single responsibility principle. Then we moved on to testing in rsync. This is still really confusing for me, but I’m slowly getting better at it. The thing that bugs me is I can’t easily see what is going on when I am testing and failing. Puts doesn’t display anything when you are running tests, and I’m not super comfortable with pry yet.

The evening homework was an interesting one. It seems to essentially be tdd. If that is the case then I’m not so sure I like tdd. We were essentially just given the tests and then had to write code to pass the tests. The difficult part for me is that I didn’t have a good overview of how the two classes we were writing would be used. I’m not sure if that should matter to me, but it did feel a bit disheartening to be blindly coding to the tests.

Ok, 10 hours is enough for today. Tomorrow will bring even more ideas and questions.

Tell me what you think.

This site uses Akismet to reduce spam. Learn how your comment data is processed.