Comment

Comment by themoonisachees

How is finally() ever useful in any language? What is the difference between

  try{
      #code that can throw errors
  } catch {
    #handle error
  } finally {
    #code
  }
And

  try{
    #throw err
  }catch {
    #handle
  }
  #code...
Surely in pretty much all languages the two are equivalent, so what is finally's purpose as a token?

The trick in this post is different because for one bash doesn't have finally, and even if it did you couldn't use it to catch all of a script's errors.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton