I find the semantics of return inside finally blocks to be confusing. With hindsight, perhaps languages shouldn't allow it.
miniblog.
Related Posts
JSON is too small (no comments) and YAML is too big (many string syntaxes, relatively few implementations).
TOML is in the sweet spot for complexity, but I agree this syntax is by far the most confusing part.
TOML 1.1 improves it at least:
I'm designing a programming language and trying to decide the type of `let x = 1;`. Should it be Unit or Int?
Advantage of Int: really convenient when evaluating snippets in a REPL.
Advantage of Unit: It's much less confusing when type inference runs on an incomplete function.
`init` feels like an unhelpful name in OO. It doesn't give you an initial value, it initialises the instance that has already been created. Developers are often surprised that init doesn't return the instance, because they have a strong association with `new Foo()`.
Perhaps `finish` would have been a less confusing name?