Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Go Error Handling Sucks

Received: by 10.58.135.42 with SMTP id pp10mr3002852veb.18.1348510603188;
        Mon, 24 Sep 2012 11:16:43 -0700 (PDT)
X-BeenThere: golang-nuts@googlegroups.com
Received: by 10.52.92.207 with SMTP id co15ls4317061vdb.5.gmail; Mon, 24 Sep
 2012 11:16:34 -0700 (PDT)
Received: by 10.52.92.207 with SMTP id co15mr2008081vdb.9.1348510594386;
        Mon, 24 Sep 2012 11:16:34 -0700 (PDT)
Date: Mon, 24 Sep 2012 11:16:34 -0700 (PDT)
From: Archos <raul....@sent.com>
To: golang-nuts@googlegroups.com
Message-Id: <228bbb5c-2210-4b06-a736-d4fd7c8b677f@googlegroups.com>
In-Reply-To: <b114ff52-39fc-473f-afbc-3d94ce6fdc67@googlegroups.com>
References: <b114ff52-39fc-473f-afbc-3d94ce6fdc67@googlegroups.com>
Subject: Re: Go Error Handling Sucks
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_501_9781519.1348510594045"

------=_Part_501_9781519.1348510594045
Content-Type: multipart/alternative; 
	boundary="----=_Part_502_14843035.1348510594045"

------=_Part_502_14843035.1348510594045
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

The language I used before of Go was Python, so the error handling in Go=20
was very strange for me at the beginning. In fact, one of the errors that I=
=20
have done in one of my first projects was to avoid its usage on the first=
=20
version, because when I started to extend that project I got errors that I=
=20
didn't know where they came from.

So, my rule is always to handle errors since it does not hurts but does=20
very robust the software.
By the way, now I want not know anymore about Python, Ruby, C++

El lunes, 24 de septiembre de 2012 16:55:57 UTC+1, (desconocido) escribi=C3=
=B3:
>
>
> Its a shame that such a fantastic language is missing a better way to dea=
l=20
> with errors.=20
> Exceptions might not be perfect, but are damn better than checking each=
=20
> and every function call.
>
> Or am I missing something?
>
> I just read a pair of posts that expresses these ideas much better than=
=20
> what I could here.
>
>
> http://uberpython.wordpress.com/2012/09/23/why-im-not-leaving-python-for-=
go/
>
>
> http://www.yosefk.com/blog/error-codes-vs-exceptions-critical-code-vs-typ=
ical-code.html
>
> As one of the comments I read said: 99% of the time I need to code the=20
> happy path and if something breaks in the middle the error handling is=20
> exactly the same: log the error, close resources, send the caller an erro=
r=20
> code or message, end of the story.  I don't want to check every freaking=
=20
> single function invocation for errors.
> Its a shame, I really wanted to use go.
>
>
------=_Part_502_14843035.1348510594045
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

The language I used before of Go was Python, so the error handling in Go wa=
s very strange for me at the beginning. In fact, one of the errors that I h=
ave done in one of my first projects was to avoid its usage on the first ve=
rsion, because when I started to extend that project I got errors that I di=
dn't know where they came from.<br><br>So, my rule is always to handle erro=
rs since it does not hurts but does very robust the software.<br>By the way=
, now I want not know anymore about Python, Ruby, C++<br><br>El lunes, 24 d=
e septiembre de 2012 16:55:57 UTC+1, (desconocido)  escribi=C3=B3:<blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
 1px #ccc solid;padding-left: 1ex;"><div><br></div><div>Its a shame that su=
ch a fantastic language is missing a better way to deal with errors.&nbsp;<=
/div><div>Exceptions might not be perfect, but are damn better than checkin=
g each and every function call.</div><div><br></div><div>Or am I missing so=
mething?</div><div><br></div><div>I just read a pair of posts that expresse=
s these ideas much better than what I could here.</div><div><br></div><div>=
<a href=3D"http://uberpython.wordpress.com/2012/09/23/why-im-not-leaving-py=
thon-for-go/" target=3D"_blank">http://uberpython.wordpress.<wbr>com/2012/0=
9/23/why-im-not-<wbr>leaving-python-for-go/</a><br></div><div><br></div><di=
v><a href=3D"http://www.yosefk.com/blog/error-codes-vs-exceptions-critical-=
code-vs-typical-code.html" target=3D"_blank">http://www.yosefk.com/blog/<wb=
r>error-codes-vs-exceptions-<wbr>critical-code-vs-typical-code.<wbr>html</a=
><br></div><div><br></div><div>As one of the comments I read said: 99% of t=
he time I need to code the happy path and if something breaks in the middle=
 the error handling is exactly the same: log the error, close resources, se=
nd the caller an error code or message, end of the story. &nbsp;I don't wan=
t to check every freaking single function invocation for errors.</div><div>=
Its a shame, I really wanted to use go.</div><div><br></div></blockquote>
------=_Part_502_14843035.1348510594045--

------=_Part_501_9781519.1348510594045--