* Volker Dobler <dr.volker.dob...@gmail.com> [200416 02:28]:
> On Wednesday, 15 April 2020 17:58:11 UTC+2, Marvin Renich wrote:
> >
> > In the Go tour at https://tour.golang.org/methods/19 it says 
> >
> >   The error type is a built-in interface similar to fmt.Stringer: 
> 
> I agree that this might be misunderstood in the sense of fmt.Stringer
> being built-in too, but if this is commonly misunderstood it probably
> is not a long-lasting, problematic confusion (for most purposes it
> simply doesn't matter wether fmt.String is a predeclared built-in or
> declared in the stdlib).

Whether the confusion is long lasting or not, it requires re-reading the
statement and possibly looking up the definition of fmt.Stringer to
understand what is being said.  Making the statement clearer on initial
read is definitely better.

> > A much better wording would be 
> >
> >   The error type is a built-in interface; its definition is similar to 
> >   fmt.Stringer: 
> 
> I think I disagree here. The similarity of error and fmt.Stringer is
> both being a one-method interface and this method has the same
> signature for both (no arguments, string return) but their _actual_
> "definition" is pretty different as one is built-in, the other isn't.

Okay, then what is the point of saying the two are "similar"?  I am
simply advocating that the fact that error is built-in be separated from
any comparison to fmt.Stringer, for whatever comparison you would like
to make.  Would you like this better (I don't particularly, but it is
better than what is there now)?

  The error type is an interface similar to fmt.Stringer, but it is
  built-in:

Making written communication easier to understand is always an important
goal, even if it means being somewhat more verbose.  This is especially
true in a tutorial such as the Go tour.

...Marvin

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20200416115637.kmi7fn5muxzwibe6%40basil.wdw.

Reply via email to