Huรขn Nhi๐ฎ๐ฉ๐๐๐ญ
@huannhi
I love how Rust, by not providing a mechanism to throw errors, forces you to think and model all possible outcomes. In my experience with TypeScript/JavaScript, I often take a more relaxed approach, where some errors are modeled while others are thrown. This depends on whether they represent valid use cases (even if they are failures) or unexpected issues (true exceptions). I'm tempted to use this in my next TS/JS project: <https://github.com/jfmengels/eslint-plugin-fp/blob/master/docs/rules/no-throw.md>
0 reply
0 recast
0 reaction