Skip to content
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

OOP Tiny-JS-World #569

Merged
merged 2 commits into from
Sep 27, 2022
Merged

Conversation

Conversee12
Copy link
Contributor

oop-tiny-js-world

Demo |
Code base

The code is submitted in a dedicated feature branch.

Only code files are submitted.

Please, review.

@github-actions
Copy link

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:

  • Make sure your code follows General Requirements
  • Use common sense or seek for an advice whenever requirements look ambiguous or unclear.

By the way, you may proceed to the next task before this one is reviewed and merged.

Sincerely yours,
Submissions Kottachecker 😺

@Conversee12
Copy link
Contributor Author

I've completed self-checks, did'nt find any common errors

@OleksiyRudenko OleksiyRudenko added the self-check-done Student confirmed that self-checks against requirements/common-mistakes are done label Sep 20, 2022
Copy link
Member

@OleksiyRudenko OleksiyRudenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Conversee12 let's make code more OOP compliant.

this.saying = saying;
}
get tinyWorld() {
return `${this.species}; ${this.name}; ${this.gender}; ${this.saying}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please employ Array methods. Starting array may not necessarily consist of strings. Actually, anything can be an array's element.

Comment on lines 26 to 27
get tinyWorld() {
return `${this.species}; ${this.name}; ${this.gender}; ${this.hands}; ${this.legs}; ${this.saying}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use method overloading.
If we add a new universally shared property, current implementation will require changes to multiple classes' code. The point of encapsulation is that every class handles its own properties and re-uses inherited methods versions to build on top of whatever they provide us with.

Let's disregard the fact that we want to "insert" information about limbs before saying, for simplification.

@Conversee12
Copy link
Contributor Author

Fixed this. Please, review

Copy link
Member

@OleksiyRudenko OleksiyRudenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Conversee12 great job done!

@OleksiyRudenko OleksiyRudenko merged commit 1db03d8 into kottans:main Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
self-check-done Student confirmed that self-checks against requirements/common-mistakes are done task-TJSW-OOP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants