On Sun, Jun 30, 2019 at 7:05 PM Jan Mercl <0xj...@gmail.com> wrote: > On Sun, Jun 30, 2019 at 3:19 PM Jesper Louis Andersen > <jesper.louis.ander...@gmail.com> wrote: > > > This is where the try-construct will definitely improve the ergonomics > of the programming. > > With full respect to you opinion and/or personal preferences, > "definitely improve" is just and only that. I _definitely_ don't share > that opinion/personal preference. >
I agree. That came out way too matter-of-factly. I think it will improve ergonomics, because of the following analysis: CON: New construct in the language means teaching and learning the language takes more time. CON: try(..) is a control operator. These are often harder to grasp and rather subtle. CON: It is sugar for a common pattern, which if written out could make code easier to read. PRO: It is sugar for a common pattern, which if not written out could make code easier to read. PRO: It will suggest a common pattern of error handling is easier to work with in Go, thus make a stylistic choice. PRO: It is, essentially, a typical Error monad. These are pretty common in code and having special tooling for them tends to help. PRO: Code is more often read then written. I think this optimizes for the reader. UNDECIDED: This is a pattern you also see in other languages. My opinion, balancing those pros and cons, is that I think it ends up being a net positive, but YMMV of course. -- J. -- 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/CAGrdgiVSF2GRX9YpebB1OuXAv%3DDfcSvvQXyCGYAPu%3D8we7C3sw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.