Which programming language first came up with the finally block?

I ask purely out of curiosity.

It is a very useful piece of syntactic sugar, and whoever first created it surely has a very impressive grasp of solutions to programming problems.

(Note: it is deceptively difficult to find an answer to this question...)

  • 3
    Why would you call it syntactic sugar?
    – Pieter B
    Commented Oct 1, 2014 at 18:05
  • 2
    Related reading: Why is there no 'finally' construct in C++?
    – user22815
    Commented Oct 1, 2014 at 18:06
  • @PieterB the block helps avoid duplicate code (copy pasting the statement into try and each catch block). A try-finally block helps avoid a try-catch-rethrow block which is ugly, harder to understand, and defeats the purpose of such blocks. To quote another source, everything can be accomplished without the finally block, but everything also can be accomplished on a Turing Machine. That doesn't make it good form, though.
    – patstuart
    Commented Oct 1, 2014 at 18:13
  • 1
    @PieterB because you can replace try{}finally{...} with try{}catch(e){...;throw e;} Commented Oct 1, 2014 at 18:39
  • 5
    @ratchetfreak It's not that simple. ... is also executed when the try block is left via any other means: continue, break, return, and whatever other control flow statements the language offers. Of course there is still a way to replace the finally with other constructs but I think it's far beyond the threshold for syntactic sugar.
    – user7043
    Commented Oct 1, 2014 at 19:03

1 Answer 1


According to wikipedia the first to introduce this was NIL.

The cleanup behavior now generally called "finally" was introduced in NIL (New Implementation of LISP) in the mid- to late-1970s as UNWIND-PROTECT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.