EMsoft-org / EMsoft-org/SHTfile

Suggestions for improved code maintainability

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
C++
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Moving code suggestions from text file to issue, see e74f766 for history before files were deleted

# SHTfile Code Review #

Over all a good piece of code and reasonably well written but there are some maintainability
issues that should be addressed before general consumption by a larger community
is established.

## Formatting ##

While the file is formatted with an eye towards presentation rather than adhering to
any standard. The use of a .clang-format file will save future maintainers from having
to tediously follow an arbitrary and undoumented formatting scheme.

* Modern C++ eschews the use of structures like the following:

char Something[8] = ".........."; // Not typical in modern C++
std::array = { "........" };

* Use 'nullptr' when you mean a null pointer, prefer not to use 0 (zero) or NULL.

typename std::enable_if< std::is_pointer::value >::type* = 0 //
typename std::enable_if< std::is_pointer::value >::type* = nullptr // Preferable

* Overriden methods should be marked as such.

void sanityCheck() const override;

* Use 'override' on destructors if that is what the intention is

~AtomData() = default;

* Use of old style or c-style casts

noteLen() = (int16_t)str.size();
noteLen() = static_cast(str.size()); // Preferable

## Auto Formatting ##
use a clang-tidy and clang-format file to automatically enforce style guidelines

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.