Feature: Arr class
Problem Statement
Currently, various array utility functions exist in the root namespace. This can lead to function name conflicts, lack of organization, and reduced maintainability. Moving these functions into a dedicated Arr
class will improve structure and make array utilities more consistent.
Who will benefit?
- Developers using array utility functions in Hazaar.
- Projects that require structured and maintainable helper functions.
- Future development by providing a clear and extendable class-based approach.
Benefits and risks
Benefits
- Namespace Cleanup: Removes clutter from the root namespace.
- Improved Maintainability: Groups all array-related functions into a single class.
- Better Discoverability: Developers can easily find and use array-related utilities.
- Extensibility: Makes it easier to add or modify array functions in the future.
Risks
- Backward Compatibility: Code relying on the existing root-level functions will need to be updated.
- Refactoring Effort: Requires replacing function calls throughout the codebase.
Proposed Solution
- Create a new
Arr
class under theHazaar
namespace. - Move all existing root-level array functions into static methods within
Arr
. - Deprecate the old global functions and provide migration documentation.
- Refactor the existing codebase to use
Arr::methodName()
instead of global functions. - Implement unit tests to ensure all functions work as expected.
Priority/Severity
-
High (This will bring a huge increase in performance/productivity/usability/legislative cover) -
Medium (This will bring a good increase in performance/productivity/usability) -
Low (anything else e.g., trivial, minor improvements)