Skip to content
This repository has been archived by the owner. It is now read-only.

Remove redundant code + add type checker #234

Merged
merged 8 commits into from Feb 1, 2019
Merged

Remove redundant code + add type checker #234

merged 8 commits into from Feb 1, 2019

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Feb 1, 2019

This pull request contains several changes that will make maintenance of the project easier going forward:

  • Inline simple wrapper methods.

  • Remove unnecessary statements such as pass or return.

  • Remove comments that only re-state information that's already in method names, parameter names, class names or type annotations.

  • Make interface method signatures more specific so that all subclasses must expect the same arguments and return the same values.

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 PR follow our Code of Conduct?

  • Have you added an explanation of what your changes do and why you'd like us to include them?

  • Does each method or function "do one thing well"? Reviewers may recommend methods be split up for maintainability and testability.

  • Is this code designed to be testable? Not applicable: refactor

  • Is the code documented well? Not applicable: refactor

  • Does your submission pass existing tests (or update existing tests with documentation regarding the change)?

  • Have you added tests to cover your changes? Not applicable: refactor

  • Have you linted your code prior to submission?

  • Have you updated the documentation and README? Not applicable: refactor

  • Is PII treated correctly? In particular, make sure the code is not logging objects or strings that might contain PII (e.g. request headers). Not applicable: refactor

  • Have secrets been stripped before committing? Not applicable: refactor

@c-w c-w changed the title Remove redundant code Remove redundant code + add type checker Feb 1, 2019
@margaretmeehan
Copy link
Contributor

@margaretmeehan margaretmeehan commented Feb 1, 2019

Many of the comments you removed are certainly redundant, though I think commenting code can be helpful for people trying to understand a code base. Would like to hear better practices for how we can comment well.

@c-w
Copy link
Contributor Author

@c-w c-w commented Feb 1, 2019

@margaretmeehan Here's a concise "styleguide" for comments that I've seen successful on many projects in the past: ncrcoe/java-for-small-teams/style/comments. Other authors (e.g. Robert Martin in Clean Code) say similar things but with more words. In general, I'd try to avoid comments as much as possible since they tend to drift from the code over time as they're often not updated when the code is changed. I've often seen higher level documentation (e.g. diagrams of how the code interacts or how the architecture maps to the code) be more valuable and require less maintenance effort over time.

Copy link
Contributor

@margaretmeehan margaretmeehan left a comment

Thanks for the responses @c-w

@c-w c-w merged commit b421798 into master Feb 1, 2019
3 checks passed
@c-w c-w deleted the remove-redundant-code branch Feb 1, 2019
sayar added a commit that referenced this issue Feb 1, 2019
@sayar sayar restored the remove-redundant-code branch Feb 1, 2019
sayar added a commit that referenced this issue Feb 1, 2019
@c-w c-w deleted the remove-redundant-code branch Feb 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants