Skip to content

Suggestions for Code Improvement #94

@thesudoer2

Description

@thesudoer2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions