FAQ

On Wednesday, February 4, 2015 at 2:04:12 AM UTC+1, Yves Junqueira wrote:
Programmers should not often omit an error return value, nor assign it to
_. Error handling in Go done explicitly because we're skeptic that any sort
of automatic handling of errors is usually better than careful analysis for
different cases.
yes. if you do explicit error handling, you are not affected by this
proposal.

Besides, I don't think it's safe to assume that the valid response to a
non-handled error is to stop running the offending function next time that
section is executed.

not the offending function, but a side effect free function that returns
just

Maybe you could give a concrete example illustrating the problem you're
trying to solve?
Again,
1) error handle cases where the programmer forgot error handling, without
affecting the program.
2) don't handle errors that
    a) don't occur in practice,
    b) are only logged (and not affecting the program flow) to improve code
readability
3) encourage programmers to put many and complex assertions, to:
   a) prevent bugs
   b) document the code contract, with minimal run time performance impact.

On Wed, Feb 4, 2015 at 1:08 AM, <anl...@gmail.com <javascript:>> wrote:

Programmers often omit an error return value (or assign to _ the sink).


The idea is at these points, to emit a fast, probabilistic run time check.


Maybe a core/stacktrace dumps, even break if in debugger. Yet continue
the execution.


Furthermore: Compiler could recognize a side effect free functions,

with 1 error return value ignored at a call site.


Compiler can emit code to skip this function call on a fast path.


Runtime probabilistic assertion checking.


--if the code gets cpu bound, switch to fast path. if done, switch to
slow path

--guess the assertion will succeed (it did many times / it checks
similiar data)

--if on low battery, run fast path only


Opinions?

--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/d/optout.


--
Yves Junqueira <http://google.com/+YvesJunqueira>
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 10 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 4, '15 at 12:08a
activeFeb 4, '15 at 8:53p
posts10
users7
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase