Re:A Modern JavaScript Tutorial
by Rumudiez on Monday December 07, 2020 @03:46PM
(#25337251)
try/catch introduces new block scopes and interrupt control flow. I find this example very readable, but expanding it into try/catches would make it rather long winded and harder to see the pattern at work as you extend the sequence:
I prefer concision and functional expressiveness because it reduces the surface area for writing buggy code. Much like how using map instead writing a for loop can eliminate out of range index bugs, chaining promises brings useful guarantees about how the code I do write can be interpreted.
[ Parent
| on HN ]
There are no comments on this comment yet.