4 ms·
Golike error handling in JavaScript and Python
- greatgib 2y agoSeriously doesn't make any sense at all. For python at least. Js I know less. Also a little bit ridiculous to take go as a reference for error management as it is probably the worse on this subject. The err = func(), in the c way is probably ok, but the errors values created on the spot anywhere in the coffee without being predefined is awful and makes code error safeness random and chaotic in my opinion. For python, you don't have to know that a function can specifically return an error. You just have to expect that everything might encounter an error and add the try/except as gatekeeper where it matters.