Open utterances-bot opened 2 years ago
you said:
When you really pass 0 as the dividend, the runtime doesn't know how to proceed.
I think that might have meant
When you really pass 0 as the divisor, the runtime doesn't know how to proceed.
Unless I have completely mistaken the point you are making.
Thanks for sharing this. ;)
Not long ago, I pondered over this question, too.
Here are my notes:
"Let it crash" is not equal to "Let everything crash". Expected errors are parts of your core logic, too. Don't let it crash.
To summarize, in BEAM-based languages:
@leed25d You are totally right, thank you for pointing it out!
It's funny because I actually googled dividend
when I wrote that sentence, and somehow I decided to use it. 😂
Anyway, it should be fixed now. Appreciated 🙏
@c4710n That's a great summary
If you don't mind, may I add it as the TL;DR
section at the beginning of the article?
@dsdshcym That's totally fine.
@dsdshcym And, feel free to edit it.
How "let it fail" leads to simpler code - Yiming Chen
The biggest lesson I learned from the "Let it fail" philosophy, is to distinguish expected errors and unexpected errors. So we can safely ignore the unexpected, and only handle the expected errors in our business logic.
https://yiming.dev/blog/2022/07/10/how-let-it-fail-leads-to-simpler-code/