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

Add discussion about preconditions & error surface area to interface tutorial #35

Open
kammce opened this issue Jun 25, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@kammce
Copy link
Member

kammce commented Jun 25, 2024

The stance is that interfaces should be designed around the philosophy that all API calls do not need to concern themselves with preconditions before being called. The API call may not behave has the user may have wanted but it will work with the conditions it currently has.

For example, if you call hal::spi::transfer and you forgot to set the clock rate, transfer wills till work, but it will use a slower clock rate. This is fine. transfer does not have any preconditions, just that the configuration is undefined from the point of view of the application and depends on what it configures at the start.

Any API that requires preconditions should be closely evaluated and a means to make the API no longer have a precondition should be sought out. We cannot avoid preconditions everywhere, but we should try to.

I'm conflicted on how this will work for networking. And I'll just leave that comment for now.

@kammce kammce added the documentation Improvements or additions to documentation label Jun 25, 2024
@kammce
Copy link
Member Author

kammce commented Jun 25, 2024

This may require some research and discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant