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

refactor: tidy up #708

Closed
wants to merge 1 commit into from
Closed

refactor: tidy up #708

wants to merge 1 commit into from

Conversation

Simon-He95
Copy link

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@manniL
Copy link
Member

manniL commented Nov 29, 2022

Thanks for your effort but I feel like the proposed improvements make the code less readable than before. Similar to previously proposed PRs. πŸ™

@Simon-He95
Copy link
Author

Thanks for your effort but I feel like the proposed improvements make the code less readable than before. Similar to previously proposed PRs. πŸ™

Why is it more difficult to understand, I just combined the conditions of the same return result, and then replaced the for that satisfies the conditions with some

@manniL
Copy link
Member

manniL commented Nov 29, 2022

Because chained logical statements can make code less readable. I'd rather have longer code that shows that the statements are separate concerns / cases than figuring out these cases in a longer chained or-statement.

If necessary, some conditions would even have an own variable that describes it. Longer code, but easier to understand.

@Simon-He95
Copy link
Author

I think finding a unique condition for returns, which just satisfies some function, can express this meaning. In addition, since they all return false, it will be more concise to use the if condition to merge and express in a new line. Returning in this case, I don't think he loses readability, it's ok, everyone's understanding is different.

@Simon-He95 Simon-He95 closed this Nov 30, 2022
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