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

Suggestions for Code Improvement #94

Open
thesudoer2 opened this issue Sep 13, 2024 · 2 comments
Open

Suggestions for Code Improvement #94

thesudoer2 opened this issue Sep 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@thesudoer2
Copy link
Contributor

Hello there,
I have some recommendation that can enhance maintainability, and performance and generally improve overall project quality.

Maintainability

  1. In general, comments make maintainability more difficult, because if you want to change a part of the code, you have to change its comment too, thus violating the duplication principle (DRY principle). Therefore, it is good to use comments only where needed and avoid commenting where the function of the code is obvious.
  2. Making the logging approach more controllable! In the current codebase, there is a general syntax for logging messages, but no function to generate them (messages are generated directly within the code). If you decide to change the logging message syntax, you would need to update all logging-related code manually, or developers would have to write the message syntax every time.
  3. Adding at least one level of abstraction for the Boost library to make the code more maintainable.

Performance

  1. Using std::make_shared instead of new for keep shared pointer control block and object block in contiguous memory blocks (better performance).

General

  1. Using #ifndef/#define and #pragma once as include guards is redundant. #ifndef/#define can be removed, and only #pragma once can be used because almost all modern C++ compilers support it.
@MortezaBashsiz MortezaBashsiz added the enhancement New feature or request label Sep 13, 2024
@MortezaBashsiz
Copy link
Owner

@thesudoer2
Thanks a lot for this evaluable suggestions
All your PRs regarding these improvements are appreciated.

@thesudoer2
Copy link
Contributor Author

@MortezaBashsiz
My pleasure :)
I will work on "Maintainability - 1" and "General - 1" sub-issues until further notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants