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

Peer-to-peer code review: Ruby capstone #47

Open
BertrandConxy opened this issue May 6, 2022 · 0 comments
Open

Peer-to-peer code review: Ruby capstone #47

BertrandConxy opened this issue May 6, 2022 · 0 comments

Comments

@BertrandConxy
Copy link
Collaborator

Hello team,

You have done a great job building this console app! 🎆

Highlights 🥇

✔️ Requirements are implemented well
✔️ The console app is working as expected without crashing
✔️ No linter errors
✔️ Use of Ruby best practices
✔️ All the unit tests are passing
However, there are some issues that I would like to present to you so that when you correct them, your codes will be clean and more maintainable than they are now.

Requested improvements ♻️

While looking through this project, I have noticed a lot of repetition of the similar blocks of codes while it is the best programming practice to always keep our codes DRY which means "Not Repeating similar codes multiple times". Every piece of knowledge must have a single, unambiguous, authoritative representation within a system (Andrew Hunt & David Thomas, "The Pragmatic Programmer"). Please try to look at these code snippet screenshots I took from some of your project files.

case 1

cat1

case 2

cat2

case 3

cat5

There is the repetition of the block of codes that is responsible to read data from the storage in every module which is the same for the case of writing data in the storage.

Suggested solution

I kindly recommend that you may create a Ruby module that handles all data manipulation operations (reading and writing data) and then include that module in every class that is responsible for displaying data in the storage or saving data in the storage.
For example
Solution

Then, after this module is included in a particular class, you can perform read operations

sln_read

And also the write operations like this;

sln_write

Thank you, happy coding! 👏

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