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

V2 : primitives revisted #697

Merged
merged 4 commits into from
Sep 28, 2020
Merged

V2 : primitives revisted #697

merged 4 commits into from
Sep 28, 2020

Conversation

z3dev
Copy link
Member

@z3dev z3dev commented Sep 25, 2020

These changes improve the checking of parameters (options) in the primitives.

NOTE: There are also changes to the tests suites to comply with coding standards.

Fixes #633
Fixes #626

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Does your submission pass tests?

@z3dev
Copy link
Member Author

z3dev commented Sep 25, 2020

There's a lot of redundant code in the primitives, especially the redundant error messages/strings. I can see two ways to address this.

  1. create a set of common functions to perform common checks, e.g. checkCenter()
  2. keep the unique checks in the code, and create a set of common functions to throw common errors

Perferences anyone? Suggestions?

@SimonClark
Copy link
Contributor

There's a lot of redundant code in the primitives, especially the redundant error messages/strings. I can see two ways to address this.

  1. create a set of common functions to perform common checks, e.g. checkCenter()
  2. keep the unique checks in the code, and create a set of common functions to throw common errors

Perferences anyone? Suggestions?

I think I'd prefer to see a set of options validator functions. Make for more readable code imo

@z3dev
Copy link
Member Author

z3dev commented Sep 26, 2020

@SimonClark thanks.

I implemented some common checks (actually more complete), and reworked the code for the primitives. Looks better, more readable, but I still don't like the redundant comments.

@z3dev z3dev requested review from kaosat-dev and SimonClark and removed request for kaosat-dev September 26, 2020 03:35
@z3dev z3dev requested a review from SimonClark September 27, 2020 07:38
@SimonClark SimonClark merged commit 4721484 into V2 Sep 28, 2020
@z3dev z3dev deleted the v2-primitives-revisted branch October 14, 2020 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants