-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Complete OOP Exercise #524
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 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, |
Self-check done. |
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.
@deveLabR pretty good job!
Let's make it more OOP compliant.
Also let's improve naming skill.
submissions/develabr/oop/index.js
Outdated
class Animal extends Creature { | ||
constructor(species, name, gender, saying, friends) { | ||
super(species, name, gender, saying, friends); | ||
this.leg = 4; |
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 makes leg
so different from name
or gender to handle leg
property in a different way?
submissions/develabr/oop/index.js
Outdated
this.gender = gender; | ||
this.saying = saying; | ||
this.friends = friends; | ||
this.args = ['species', 'name', 'gender', 'saying', 'friends']; |
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.
Inhabitants are characterized rather by properties or features. No one says 'Name is my argor
Gender is my arg`
submissions/develabr/oop/index.js
Outdated
this.args = ['species', 'name', 'gender', 'saying', 'friends']; | ||
} | ||
personInfoItems() { | ||
return this.args.map((key) => this[key]).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.
key
is a generic, technical term.
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.
@deveLabR please revisit the requirements and education materials and make the code OOP-compliant.
Feel free asking questions here or in Students' chat.
submissions/develabr/oop/index.js
Outdated
this.name = name; | ||
this.gender = gender; | ||
this.leg = leg; | ||
this.hands = hands; |
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.
From the requirements:
Classes for species that do not have hands by natural design do not consequently have hands or any equivalent property
Subclasses inherit all properties from parent classes, which means they have it.
Oops, I wanted it to be better, but it turned out as usual (( I'll fix it now |
Use method overloading and |
I hope I understood correctly how to use overloading methods |
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.
@deveLabR great job!
OOP exercise
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.