Skip to content

[EPIC] Design improvements #32

@jonblack

Description

@jonblack

Looking at the code there are a lot of improvements that can be made to the design to make the code easier to understand and maintain. As new issues are discovered, add them here:

Let's chat before anything gets implemented.

  • Refactor functions that take too many parameters. Too many is something you'll know when you see it (e.g. msa::perform_msa_round_gapped)
  • Use smart pointers (std::shared_ptr and std::unique_ptr)
  • Improve comments (see Improve comments in code #31)
  • Don't pass by non-const reference. It's unclear in the caller that the value might be changed. Use a pointer instead.
  • Run cppcheck --enable=all src/ and fix issues. Read its documentation because unusedFunction is run and it can produce false positives.
  • Use OOP for methods that operate on an object (e.g. make_string only ever operates on a Sequence so should be a member function of Sequence).
  • Create Alignment class. This term appears very often. It's comparison operators should implement seq_data::compare_alignments so you can then do if alignment1 == alignment2 in the code.
  • Let the compiler infer the type using auto. This makes code much more readable (assuming your function name indicate clearly what's happening).
  • Give functions meaningful names (e.g. fasta::make_string should be fasta::sequence_to_string or better Sequence::to_string)
  • Rename all the fasta stuff to something else because it's not fasta and that's confusing.
  • Do we really need python scripts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions