-
Notifications
You must be signed in to change notification settings - Fork 25
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
Panda & Tiger level complete #10
base: master
Are you sure you want to change the base?
Conversation
year: struct.year, | ||
score: struct.ratings["critics_score"] | ||
) | ||
rescue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather you be more explicit about catching that there were no movies returned. Here you are returning nil if there was any exception.
Nice job with the user class and tests -- it flowed well. As far as explaining the Eagle -- if the slope of the line of your average ratings of movies is increasing, then you're getting happier. If it's decreasing, then you're getting more upset. |
I completed the Eagle level, (or at least my interpretation of it!). It basically calculates the slope based off of the year you 'added the movie to your likes'. So to actually calculate the slope you would have to wait till next year to begin adding movies to see whether you are getting better or worse at picking movies over time. (Notwithstanding, I tried writing some specs to prove this logic indeed works). |
I think this looks great... one minor note: It's the year of the movie that I was thinking would matter on the slope --- if a movie in 1985 you liked was just OK, and in 2010 was GREAT, then the slope would be positive... Not necessarily recording the data in 1985, just that the movie was in 1985. That said -- you've definitely accomplished this pull. go you! |
ah ok, I had a feeling I wasn't following along with the instructions. It was good practice nonetheless! Any suggestions as to how to better use a begin/rescue block when handling exceptions? I wasn't sure what else to put in the rescue block other than nil when I first tried to use it? |
For begin/rescue I recommend two rules:
Good:
Bad:
|
I've calculated the average year of all the movies the user has liked, but I"m not sure if that's what you meant in your instructions?
Would you mind please clarifying the instructions in the Eagle level? Thanks!