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

CHECK outside of loop (CHECK 02) should be more smart #1095

Open
alezhu opened this issue Dec 15, 2022 · 1 comment · May be fixed by #1097
Open

CHECK outside of loop (CHECK 02) should be more smart #1095

alezhu opened this issue Dec 15, 2022 · 1 comment · May be fixed by #1097

Comments

@alezhu
Copy link

alezhu commented Dec 15, 2022

CHECK 02 does not allow CHECK for exit from block except loops. It required RETURN for this.
And it used Programming Guideline Only use RETURN to exit procedures) to justify it.

BUT! That guideline has Exception section:

An exception to the rule to only use RETURN to exit procedures are CHECK statements that are located at the beginning of a procedure and that check the prerequisites for the execution of the procedure there. Using the CHECK statement in such a way does not impair the legibility and is thus allowed. However, this exception does not apply to other positions within a procedure and outside loops.

@larshp
Copy link
Owner

larshp commented Dec 15, 2022

thanks, pull requests welcome

@alezhu alezhu linked a pull request Jan 17, 2023 that will close this issue
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 a pull request may close this issue.

2 participants