Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish challenge #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Finish challenge #68

wants to merge 2 commits into from

Conversation

lnestor
Copy link

@lnestor lnestor commented May 11, 2018

@jaybobo Last one!

@lnestor lnestor changed the title WIP Initial commit Finish challenge May 11, 2018
end

def dead?
!self.alive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are consistently using the self.attribute for setting/changing values and just the bare attribute for reading values, except this one reader. Maybe change this one to !alive?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikegee what's your preference for defining attributes? ivars or using self as done here? And why? :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer defining the attribute methods and using them exclusively. Instance variables with typos raise no error, Ruby happily returns nil. Method calls with typos raise NoMethodError. I prefer feedback as early as possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this particular line, I suggest removing the self. prefix but continuing to call the reader method.

@mikegee
Copy link
Member

mikegee commented May 14, 2018

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants