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

Code refactor with targetting better readable and maintainable code #160

Open
ceskyDJ opened this issue Nov 7, 2024 · 1 comment
Open

Comments

@ceskyDJ
Copy link
Contributor

ceskyDJ commented Nov 7, 2024

Hi guys! I have just one little note for this project. As it settles down, I think there is a place to consider increasing its code quality. You can profit from it in the future, as changes will be easier and more people will be willing to contribute. I guess you are beginners, so this is not a priority for you, but I think it could improve your coding skills and the quality of this project, too. Please don't see this as a criticism but rather as a way for you to improve yourself and this work.

Some recommendations for a start:

  • Divide the huge script.js file into modules that are responsible for just one thing.
  • Use OOP principles.
  • Put the initialization together in one place (now it's spread as function calls across script.js).
  • Unify usage of event handlers. Place them in similar places so it's predictable where they are and easy to understand how the whole thing works.
  • Divide scripting (JS) from styling (CSS).
  • Simplify long functions.

I'm not an expert in code style, code maintainability, etc., so please find better sources and use them as an inspiration rather than my recommendations.

@itz-rj-here
Copy link
Contributor

I'm a junior dev. I might need time to know all about this. Tell @prem-k-r he has a big brain 🧠. He can do that. 😁

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

2 participants