Skip to content

Consolidating some things #720

@defaude

Description

@defaude

Hey everyone! I just arrived here at this repo and would love to contribute a bit :)

Looking at the code organisation and the test setup, it's rather confusing for newcomers right now. Should we discuss those cross-cutting things a bit and then decide the direction going forward? Here's a few ideas - feedback very much welcome:

Ideas

Code structure: Maybe we could define a "template" for code/algorithm files that new code should follow and/or existing code could be migrated towards. Some things to keep in mind, though:

  • Implementation files (modules?) should adhere to a common structure (e.g. ESM)
  • Implementation code should be stateless (i.e. it should be possible to call the implementation multiple times without side effects between test runs)
  • Algorithm implementation should refrain from outputting to the console
  • ... (ideas welcome)

Chores: Automatically running tests and code style checks in the CI is a bit funky right now ;) Mostly due to the fact that there's both Jest and doctest in the mix, of course. However, there's more to do: npm dependencies are outdated, Node.js will have v16 as LTS version starting this October, etc. etc. etc.

Full switch to ESM: Add "type": "module" to our root package.json.

Addressed already:

#742

Test setup: There should be just one solution for testing. Do we want to use doctest going forward? Or do we want to use Jest? But keeping both is a source of confusion and will eventually lead to degrading code quality / clarity. (This is basically the attempt to revive the discussion in #142 even though I'd prefer and strongly recommend Jest)

Metadata

Metadata

Assignees

Labels

featureAdds a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions