Survey about Exception handling ala try-catch

181 views
Skip to first unread message

Per Arneng

unread,
Sep 2, 2011, 1:10:38 PM9/2/11
to golan...@googlegroups.com
Hello,

I know this subject has been discussed a lot and there are some strong feelings around the subject. I made
a small survey about try-catch like exception handling that is common in most modern languages. The reason
I made the survey is that i would like to know what the majority of people feel about using try-catch to handle
exceptions.

There are only 94 replies from the readers of reddit r/programming so it is not enough to be statistically accurate.
I followed the survey summary and as the replies flowed in there was very little fluctuation in the summary
graphs so i would be surprised if the numbers looked extremely different if i got 1000 replies.

I like Go and many of the features of Go and especially that it is compiled to native code. Im a Java programmer
but I love to explore new languages. I think that Go has potential but i think that it will be hard to win over the
Java and .NET programmers if there is no support for try-catch like exception handling. In the Java community i feel
that there is more buzz around Scala and Groovy than Go. Adding try-catch like exception to the language would
make .NET, Java and python programmers feel more comfortable and speed up the adoption of Go.

Best Regards,
Per


exception_survery.pdf

Rob 'Commander' Pike

unread,
Sep 2, 2011, 6:09:55 PM9/2/11
to Per Arneng, golan...@googlegroups.com
Choosing what to put in a language by selecting those features that will maximize the number of users you get will yield a large community but not a good language. C++ is the test case.

I gave a talk at OSCON that was in part about how the features of Go were chosen. Here are the slides.

http://assets.en.oreilly.com/1/event/61/The%20Expressiveness%20of%20Go%20Presentation.pdf

-rob

Tarmigan

unread,
Sep 2, 2011, 6:35:08 PM9/2/11
to Per Arneng, golan...@googlegroups.com
On Fri, Sep 2, 2011 at 10:10 AM, Per Arneng <per.a...@anyplanet.com> wrote:
> I think that Go has potential but i
> think that it will be hard to win over the
> Java and .NET programmers if there is no support for try-catch like
> exception handling.

http://goo.gl/QGtsL

Andy Balholm

unread,
Sep 2, 2011, 7:45:34 PM9/2/11
to golan...@googlegroups.com
The survey questions are misleading, because they don't specify what features try/catch exceptions are being compared to. Go's panic/recover mechanism is similar enough in principle to try/catch that many programmers (if they knew it exists) would consider it to be try/catch with a different syntax. Others would see it as a different feature, but realize that it provides most of the functionality they need from exceptions.

Andy

peterGo

unread,
Sep 2, 2011, 8:48:18 PM9/2/11
to golang-nuts
Per,

On Sep 2, 1:10 pm, Per Arneng <per.arn...@anyplanet.com> wrote:
> There are only 94 replies from the readers of reddit r/programming so it is
> not enough to be statistically accurate.

The survey is not well designed. Even with a million replies, the
survey results would still be meaningless.

Peter
>  exception_survery.pdf
> 100KViewDownload

Jesse McNelis

unread,
Sep 2, 2011, 11:36:13 PM9/2/11
to golan...@googlegroups.com
On 03/09/11 03:10, Per Arneng wrote:
> Hello,
>
> I know this subject has been discussed a lot and there are some strong
> feelings around the subject. I made
> a small survey about try-catch like exception handling that is common in
> most modern languages. The reason
> I made the survey is that i would like to know what the majority of
> people feel about using try-catch to handle
> exceptions.
>

Perhaps you should also ask,

"Have you used a modern language without try-catch style error handling?"

Most of the popular modern languages do. I would imagine most of your
respondents don't actually know what it's like to use a modern language
without exceptions and they imagine that the only alternative is C like
in-band errors instead of Go's multiple return values.

The additional flow control mechanism introduced by exceptions can
create some hard to detect bugs and changes to program flow that aren't
actually visible in the calling code.This is worrying in large code bases.

- jessta

unread,
Sep 3, 2011, 4:43:57 AM9/3/11
to golang-nuts
On Sep 3, 12:09 am, "Rob 'Commander' Pike" <r...@google.com> wrote:
> Choosing what to put in a language by selecting those features that will maximize the number of users you get will yield a large community but not a good language. C++ is the test case.

I think it is much more complicated than what you just wrote, from a
multitude of viewpoints.

Paulo Pinto

unread,
Sep 3, 2011, 7:20:48 AM9/3/11
to golang-nuts
Well, to be honest C++ has become as it is, become of many decisions
to keep it as
compatible as C as possible, and still allow for many modern
programming paradigms.

I think Go might eventually get to replace C as a system programming
language, but I don't
see Go getting to replace Java, C#, C++, F#, Scala, Clojure, among
others. It just lacks
too many abstractions that those languages offer and most programmers
are used to.

I like to play around with Go because of the similarities it has with
Oberon, which is
kind of dead nowadays, and because I would like that eventually we
(mankind) start using
safe languages for system programming.

--
Paulo


On Sep 3, 12:09 am, "Rob 'Commander' Pike" <r...@google.com> wrote:
> Choosing what to put in a language by selecting those features that will maximize the number of users you get will yield a large community but not a good language. C++ is the test case.
>
> I gave a talk at OSCON that was in part about how the features of Go were chosen. Here are the slides.
>
> http://assets.en.oreilly.com/1/event/61/The%20Expressiveness%20of%20G...
>
> -rob

Bruce Eckel

unread,
Sep 3, 2011, 3:58:51 PM9/3/11
to Rob 'Commander' Pike, golan...@googlegroups.com
One of the things I really like about Go is that it has clearly
questioned every bit of current "knowledge" we have about programming.
One very good question is whether exception handling is really the
best way to deal with errors. I've written fairly extensively
asserting that *checked* exceptions are a failed experiment, and I
love how Go implicitly asks about exceptions themselves. The answer
could still be that they are a good idea, but testing the premise is
very valuable.

I also love that Go is *not* saying "how can we attract the interest
of the programming hordes." Java has been done, thank you, and can
continue down that path, along with its hordes. I'm far more
interested in pursuing "best" for various meanings of that word. That
pursuit will produce far better results for the world than emulating
Java's marketing approach to language design.

-- Bruce Eckel
www.Reinventing-Business.com
www.MindviewInc.com

Sindre Myren

unread,
Sep 3, 2011, 4:59:06 PM9/3/11
to Per Arneng, golan...@googlegroups.com
Per... Multiple return values is, in my opinion, so much cleaner then
try-catch. We still have the panic in go, if some critical fault
should occur. Crashing the entire program upon any unhandled Exception
(as in the classic try-catch regime), is not an overall good design
for a system programming language:P

Other then that, I don't see that your survey mentions try-catch
anywhere! Google go defiantly has an exception handling mechanism.
It's just better and safer then plain old try-catch:)

-- Sindre


2011/9/2 Per Arneng <per.a...@anyplanet.com>:

Per Arneng

unread,
Sep 3, 2011, 10:54:21 PM9/3/11
to Sindre Myren, golan...@googlegroups.com

Hi,

The summary from google forms does not include the subtitle of the form for some reason. When the user answers the form he/she can clearly see that it is try-catch that the survey is about.

/per

unread,
Sep 4, 2011, 5:50:06 AM9/4/11
to golang-nuts
On Sep 3, 10:59 pm, Sindre Myren <smyr...@gmail.com> wrote:
> Per... Multiple return values is, in my opinion, so much cleaner then
> try-catch.

It depends on the problem that the program is solving or modelling.
Reply all
Reply to author
Forward
0 new messages