Source
- URL: https://x.com/alexdotjs/status/1704472735219339585
- Author: Alex / KATT 🐱 (@alexdotjs)
- Posted: 2023-09-20 12:29:02
Thread
1/ @alexdotjs
TIL that this is correct syntax and that finally runs after the return of the function
2/ @ThePrimeagen
@alexdotjs
Try catch is a mistake
3/ @rfleury
@ThePrimeagen @alexdotjs
“Error data” is not special data, and doesn’t deserve special treatment via special language features. Error conditions are just conditions, and code needs to be prepared one way or another for all plausible conditions
4/ @eloytoro
@rfleury @ThePrimeagen @alexdotjs
How about panics
5/ @rfleury
@eloytoro @ThePrimeagen @alexdotjs
Panics are reasonable but are appropriate for a very small % of what people call “errors”
6/ @eloytoro
@rfleury @ThePrimeagen @alexdotjs
the problem is when there’s no semantic difference between an exception and a panic, like in JS/Java/C++ etc