Stephla / pwp-capstones

0 stars 0 forks source link

TomeRater Project Review #1

Open gnaww opened 6 years ago

gnaww commented 6 years ago

Rubric Score

Criteria 1: Valid Python Code

So close here! You had the correct error checking for get_average_rating in class Book but didn't account for the same possibility of having 0 ratings in class User. Also, in get_average_rating for class Book if the book has no ratings the error message will print properly but Python will throw an error UnboundLocalError: local variable 'average' referenced before assignment for return average.

Criteria 2: Implementation of Project Requirements

Criteria 3: Software Architecture

Great job with this! The classes are well defined and none of your functions are redundant, you use other already created functions where applicable. Also very nicely commented code, that is a great practice to have!

Criteria 4: Uses Python Language Features

Overall great job not remaking the wheel. There is one case where you could have used a Python built in function for finding the maximum value in a list/dictionary, you can look into a alternative way of doing it here: https://stackoverflow.com/questions/268272/getting-key-with-maximum-value-in-dictionary. Your way works great however! Another small thing, for blocks of code like

book = Book(title, isbn)
return book

or

if (self.title == other_book.title) and (self.isbn == other_book.isbn):
    return True
else:
    return False

you can just do return Book(title, isbn) and return (self.title == other_book.title) and (self.isbn == other_book.isbn). It improves readability and lessens the amount you have to type!

Overall Score: 11/16

Overall, still a really good job! A small mistake brought down your overall grade a lot but I can see that you have a good understanding of Python and all its features!

Stephla commented 6 years ago

Thanks for the feedback! It's indeed unfortunate to only get 1 point because of one small mistake. So, what's the next step? Is this sufficient to pass the course or should I rewrite/improve my code? I'll probably have a look at it anyway based on your comments, but should I submit it again after making changes? Thanks!

gnaww commented 6 years ago

You don't need to resubmit your project, this is more to help point out things you can improve on and things you did well!