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

How to handle non valid input/output in functions #158

Open
kjvbrt opened this issue May 3, 2022 · 0 comments
Open

How to handle non valid input/output in functions #158

kjvbrt opened this issue May 3, 2022 · 0 comments

Comments

@kjvbrt
Copy link
Contributor

kjvbrt commented May 3, 2022

Writing few more tests for the functions in myUtils.h/cc I'm wondering what is the preferred way to handle non valid input. Whether at all check for it and also how to handle if function wants to return non valid output.

Checking validity of input variables in every function might affect performance, on the other hand having no way to signal something is wrong is also not good.

I'm inclined to use exceptions if non valid value is detected, question is where and how to catch them.

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

No branches or pull requests

1 participant