-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
a-tiny-js-world-OOP #357
a-tiny-js-world-OOP #357
Conversation
Hey! Congratulations on your PR! 😎😎😎 Let's do some self-checks to fix most common issues and to make some improvements to the code before reviewers put their hands on the code. Go through the requirements/most common mistakes listed/linked below and fix the code as appropriate. If you have any questions to requirements/common mistakes feel free asking them here or in Students' chat. When you genuinely believe you are done put a comment stating that you have completed self-checks and fixed code accordingly. Also, be aware, that if you would silently ignore this recommendation, a mentor can think that you are still working on fixes. And your PR will not be reviewed. 😒 A Tiny JS World -- (pre-OOP) exercise check listRelates to Object-Oriented JavaScript task. Check-list - definition of done
Universal recommendations:
Also take a note of the requirements above and follow them in all your future projects. By the way, you may proceed to the next task before this one is reviewed and merged. Sincerely yours, |
I have finished self-checks |
Hey! Congratulations on your PR! 😎😎😎 Let's do some self-checks to fix most common issues and to make some improvements to the code before reviewers put their hands on the code. Go through the requirements/most common mistakes linked below and fix the code as appropriate. If you have any questions to requirements/common mistakes feel free asking them here or in Students' chat. When you genuinely believe you are done put a comment stating that you have completed self-checks and fixed code accordingly. Also, be aware, that if you would silently ignore this recommendation, a mentor can think that you are still working on fixes. And your PR will not be reviewed. 😒 Please, make sure that your code follows the requirements based on the most common mistakes as well as both basic and advanced requirements from the original task. Universal recommendations:
By the way, you may proceed to the next task before this one is reviewed and merged. Sincerely yours, |
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.
@NadiaVorontsova great job!
Let's take a bit of care of our peer developers that may be tasked to add 100's of men and women.
const man = new Man('Yura', 'male', 'Oksana'); | ||
const woman = new Woman('Oksana', 'female', 'Yura'); | ||
const catWoman = new CatWoman('Halle Berry', 'female', 'Sarah'); |
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.
WHy do we want users to specify gender when creating men and women?
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.
oops it was by accident. I changed it!
return `I am a <strong>${this.species}</strong>; My name is <strong>${this.name}</strong>; I am a <strong>${this.gender}</strong>; | ||
I say: <strong>'${this.saying}'</strong>; My friends: <strong>${this.friend}</strong>`; |
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.
Not required to implement here. Just an idea for one of possible ways to add readability for long strings.
[
"text",
this.property,
"more text",
this.anotherProperty,
].join("; ");
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.
Thanks for this example. I used it)
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.
@NadiaVorontsova well done.
There is yet some room for improvement and discovery.
this.legs = 2; | ||
this.hands = 2; | ||
} | ||
printHuman() { |
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.
What if we could rename this method as printInhabitant
? Same refers to printAnimal
.
We probably would not need separate lists for people and animals at the end of the code.
There is a problem -- the method will try to call itself in an endless loop under current implementation due to this.printInhabitant.
See how super
can help you out.
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 did it) cool
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.
@NadiaVorontsova great job done!
Thank you) |
A-tiny-js-world-OOP
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.