These are chat archives for andela/andela-21-lite

25th
Aug 2016
clarch
@clarch
Aug 25 2016 07:32
@Antoh1 oh yeah that makes sense. Although I still think it depends, for instance if def yearPasses() is the only method that you are going to create that uses self.age then having the if statement inside the method would make sense and so for my code it would do but what happens when I want to create several other methods that use self.age, say like def monthPasses() and def decadePasses() how then would I go about it efficiently without repeating the if statement every time I create one.
Anthony Tirop
@Antoh1
Aug 25 2016 09:41
@clarch your idea is awesome too, but I am concerned with a newbie going through your code having in mind what the init function does, so to me it might bring some confusion to the newbie. Yes it works, but to enable clean code. You can define the statement and save it in a variable to be reused in other functions.
Am not specifically talking about that single if statement, what if you encounter several like those which will tempt you to put all of them in the init function!! the constructor might eventually lose its scope.