Company
Date Published
Author
Jimmy Zelinskie
Word count
485
Language
English
Hacker News points
None

Summary

The concept of "Failed Open" or "Fail Closed" refers to how a system handles unexpected failure scenarios. When something "fails open", it means that the gates are open and anything can get inside, whereas when something "fails closed", the gates remain closed and nothing can get inside. The choice between fail-open and fail-closed depends on the control flow of programming languages and the specific requirements of the code. Fail-open style code can be beneficial in situations where expensive or side-effectful functions need to be run only after filtering all successful requests, but it can also lead to deeply nested and hard-to-read code if not managed properly. The key is to decide for yourself where to risk writing fail-open or fail-closed code based on the specific requirements of your project. Understanding these concepts can help software engineers make informed decisions about their code's behavior in unexpected failure scenarios.