github-readme-quotes icon indicating copy to clipboard operation
github-readme-quotes copied to clipboard

Remove redundant code [Refactoring]

Open shravan20 opened this issue 3 years ago • 9 comments

Is your feature request related to a problem? Please describe. Constant Values stored as JSON values are duplicated across the frontend and backend version.

Describe the solution you'd like Remove the duplicated version inside the /frontend/src/util/animation/index.js file and use the existing backend-version src/animations/animation.js file

shravan20 avatar Apr 30 '21 04:04 shravan20

Hi @shravan20 , I was studying the codebase, and wanted to start contributing.

This issue #135 seems like a good start. My question is should I delete the duplicate file altogether or just use the existing backend version while keeping the duplicate.

Thanks & Regards, Raj Karmakar

raj5036 avatar Aug 27 '21 08:08 raj5036

Hello @shravan20, I was walking through the code and as you have mentioned I found that the animation file is repeated in the frontend as well as backend. I think we can remove this redundant code in the below two ways

  1. As you have told, we can keep the backend-version as it is and remove the frontend animation file, and further update the imports wherever the file has been used.
  2. Else, we can have a global util directory, where we can place those files or utility functions that will have the same functionality in the frontend and backend.

I think the second approach is better, because in this way the file directory will be more understandable for everyone. If we follow the first approach then there can be some ambiguity in the frontend side when we are doing imports from the backend and also suppose in the future if the backend and frontend are split into different repositories then that may break the code.

Please let me know which method you think will be best and then I can start working on it if @raj5036 have not started the work.

VishalSharma2000 avatar Aug 27 '21 17:08 VishalSharma2000

Hi, is this issue still open ? May i work on it ?

Peallyz avatar Dec 20 '22 10:12 Peallyz