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

[Refactor] Move String Manipulation Code to a Utility Folder #46

Closed
6 tasks
pedrobiqua opened this issue Jan 24, 2025 · 0 comments · Fixed by #48
Closed
6 tasks

[Refactor] Move String Manipulation Code to a Utility Folder #46

pedrobiqua opened this issue Jan 24, 2025 · 0 comments · Fixed by #48
Assignees
Labels
C++ enhancement New feature or request refactor

Comments

@pedrobiqua
Copy link
Collaborator

🎯 Reason for Refactoring

Currently, the codebase contains duplicate implementations of string manipulation logic in two different places. This duplication violates the DRY (Don't Repeat Yourself) principle and increases the risk of inconsistency or errors during future updates. Refactoring this functionality into a centralized utility folder will improve maintainability and scalability.


🔍 Current Code Description

  • String manipulation logic is implemented in two separate modules with identical functionality.
  • This duplication makes it harder to maintain and increases the risk of inconsistencies when changes are required.
  • The current approach lacks modularity and leads to unnecessary code repetition.

✅ Proposed Solution

  1. Create a new folder named util to house reusable utility functions.
  2. Move the string manipulation logic to a new module within the util folder (e.g., string_utils.h and string_utils.cpp).
  3. Refactor the existing modules to use the centralized utility functions for string manipulation.
  4. Ensure the utility functions are generic and well-documented for reuse.

📈 Expected Impact

  • Code Maintainability: Centralizing the logic will make it easier to update and debug.
  • Code Reusability: Other parts of the codebase can use the utility functions without duplicating logic.
  • Readability: The main modules will become cleaner and more focused on their primary responsibilities.
  • Scalability: Facilitates future enhancements to string manipulation logic without introducing additional duplication.

🛠️ Completion Checklist

  • Create a util folder.
  • Implement a new module for string manipulation in util.
  • Refactor the existing modules to use the utility functions.
  • Verify functionality through unit tests for the utility functions.
  • Ensure all existing tests pass and cover refactored logic.
  • Update any relevant documentation to reflect the changes.

📂 Related References

  • Related issue: #123
  • Documentation link: N/A
  • Previous discussion: N/A

💡 Additional Notes

  • Consider adding more utility functions to the util folder in the future to promote reusability across the project.
  • This refactoring task is independent and can be performed without impacting ongoing development efforts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ enhancement New feature or request refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant