-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
OOP JS-World #515
base: main
Are you sure you want to change the base?
OOP JS-World #515
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, |
I have completed self-checks and fixed code accordingly. |
sent all variables to class Inhabitant
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.
@IhorOzerov quite a decent job.
What confuses is drastically different approach to treating hands compared to other properties.
Leverage OOP and make code more obvious. Code is written for other people.
this.creature = "Cat-Woman" | ||
} | ||
} | ||
|
||
//, | ||
let Gangster = new Cat("Gangster", "male", "Yohanna and Vanessa"); | ||
let Nancy = new Cat("Nancy", "female", "Gangster and Vanessa") | ||
let Gregory = new Man("Gregory", "Vanessa and Bandit"); | ||
let Andy = new Man("Andy", "Rosemary and Charlotte"); |
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.
Make code style consistent. Looks like a composition of code fragments from various sources.
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.
If you say about "comment lines", that was my try to change Cat saying by click on button. Forget to delete all unnecessary lines.
Already deleted
this.hands = 2 | ||
} | ||
inhabitantSpeech() { | ||
return super.inhabitantSpeech(`Hi, i am a `, `, my name is `, `, i am nice `, `. With my ` + 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.
As a peer developer tasked to work on this project I am quite confused with how hands are treated.
Looks like a limp insertion...
I am also designing a child class for birds and trying to re-use what's already done here.
So I put super.inhabitantSpeech(
and IDE Intellisence tells me that the method expects to receive creatureText, nameText, genderText, legsText, friendsText, sayText
, i.e. no place for hands or wings...
Should I follow the same coding pattern?
OOP can help you writing a better reading and consistent code.
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.
- In the case of a bird, I think that hands or wings will be added in the same way because I can't give property "wings" to all inhabitants
- Please give some advice on what exactly I need to improve on that situation. In my previous version I had another way to make method, and this method looks better, but it doesn't contain properties in father class. If it's ok i will remove my code to previous version.
This issue has been automatically marked as stale because there were no activity during last 14 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. А. Чому так? Б. Що робити, якщо в піарі нема оновлень, оскільки не зрозуміло, що треба зробити? В. А якщо я все зробив(ла) і це ментор не рев'юває мої зміни?
Г. Хіба недостатньо того, що я додав(ла) коміт із змінами? Традиційна пропозиція: задай питання по вищенаписаному в студентському чаті. |
OOP exercise
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.