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

Use assertions in code #1

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Use assertions in code #1

merged 1 commit into from
Sep 8, 2021

Conversation

szelongq
Copy link
Owner

@szelongq szelongq commented Sep 8, 2021

There are a number of assumptions made in the code about the
program's flow of control and input of certain non-public methods.

These assumptions are not checked and could potentially lead to bugs
that are hidden in the program.

Let's use assertions to document these important assumptions that
should hold true during execution of the code.

Assertions do not have a heavy impact on performance and allows
quick detection of bugs arising from the assumptions made in the code.
They also help to document some of the logic in the code and improves
maintainability of the program.

There are several methods that convert a collection to a set. In somerrr
There are a number of assumptions made in the code about the
program's flow of control and input of certain non-public methods.

These assumptions are not checked and could potentially lead to bugs
that are hidden in the program.

Let's use assertions to document these important assumptions that
should hold true during execution of the code.

Assertions do not have a heavy impact on performance and allows
quick detection of bugs arising from the assumptions made in the code.
They also help to document some of the logic in the code and improves
maintainability of the program.
@szelongq szelongq merged commit 51866b8 into master Sep 8, 2021
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.

1 participant