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

Readability 📚 #24

Open
ByteSizedIT opened this issue Jun 15, 2023 · 0 comments
Open

Readability 📚 #24

ByteSizedIT opened this issue Jun 15, 2023 · 0 comments

Comments

@ByteSizedIT
Copy link

ByteSizedIT commented Jun 15, 2023

A few thoughts/suggestions about the code readability:

  • I see that you have moved some of your functions outside of your App component to make it more modularised 🙌. An additional suggestion would be to put your components in their own folder, nested in src. You could also put the 'helper' function files into their own file/folder (e.g helpers or utils). These conventions are not strict rules, but as your project grows it makes it easy for developers to find and reuse the extracted functions.

  • You seem to have created a function that simply calls another function with the same parameters here in gameLoop.js 👀:

image
  • Passing props. A small thing, but you have passed props in differing ways. The cohort debated whether to destructure props but, even if a stylistic choice has been made not to, this is maybe a good prompt to think about consistency and what makes the code most readable to other developers. Just food for thought 🤔....

For Hero you have passed/used it like this:
image

image

For Villain and Projectile you have passed/used it like so:
image

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant