News for hackers. Stuff that matters.
Re:Isaacs: try/catch is an anti-pattern by dchest on Monday November 14, 2011 @11:34AM (#3234570)
When writing, say, a parser, I'd rather throw and catch exceptions.

Which is also possible in Go, and template parser from its standard library is, actually, written in this style:

http://golang.org/src/pkg/template/parse/parse.go#L96

Functions call panic() (via t.errorf) to avoid passing errors between multiple levels of functions, but then Parse method catches it with recover(), checks what kind of error it is, and either panics again if it's a runtime error, or returns other kinds of errors.

There are no comments on this comment yet.