Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-09 Thread Nicolas Grilly
On Tue, Jul 9, 2019 at 4:44 PM Space A. wrote: > Did you ever read below the title > Yes, I did. I even read the full proposal, all the comments and related issues in the issue tracker, and all the messages in this thread and other threads on golang-nuts. This is why I wrote this message :-) --

Re: [go-nuts] Re: `on err` alternative to `try()` has traction...?

2019-07-09 Thread Nicolas Grilly
On Tue, Jul 9, 2019 at 3:36 PM Wojciech S. Czarnecki wrote: > Because given piece of contemporary production code may succeed in > only ONE way, but it may FAIL in many ways. If a piece of code may fail in many ways, then it will probably have several if blocks, and try will not be used. I don'

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-09 Thread Nicolas Grilly
On Tuesday, July 9, 2019 at 12:44:12 PM UTC+2, ohir wrote: > > Harsh reactions stem from what experienced programmers see as `unintended > consequences` > Don't you think that the "experienced programmers" composing the Go team are also able to foresee and assess the consequences of the try prop

Re: [go-nuts] Re: `on err` alternative to `try()` has traction...?

2019-07-09 Thread Nicolas Grilly
On Tue, Jul 9, 2019 at 2:00 PM Ian Davis wrote: > It's quite a bit more than a just new function since it brings some new > behaviours that we don't have for functions in Go at the moment: > > 1. like panic it interrupts its caller's control flow > > 2. It may only be used within functions/method

Re: [go-nuts] Re: `on err` alternative to `try()` has traction...?

2019-07-09 Thread Nicolas Grilly
On Tue, Jul 9, 2019 at 1:57 PM Jan Mercl <0xj...@gmail.com> wrote: > It's not verbosity. It's error handling. And because error handling is > usually not the happy path, it's good when it stands out clearly. That > improves readability as the important part catches attention easier. > I agree tha

[go-nuts] Re: `on err` alternative to `try()` has traction...?

2019-07-09 Thread Nicolas Grilly
On Thursday, July 4, 2019 at 5:14:40 PM UTC+2, Michael Ellis wrote: > > In my view, saving a few keystrokes is not the reason to support such a > test. I've already got an editor snippet that generates a default "if err > != nil ... " clause. > The goal of the try proposal is not to "save a few

[go-nuts] Re: `on err` alternative to `try()` has traction...?

2019-07-09 Thread Nicolas Grilly
On Thursday, July 4, 2019 at 10:55:50 AM UTC+2, Slawomir Pryczek wrote: > > going to turn code into unreadable, fragmented mess > Do you really think that replacing: f, err := os.Open("file.txt") if err != nil { return err } By: f := try(os.Open("file.txt")) Will "turn code into unreadable,

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-09 Thread Nicolas Grilly
On Monday, July 1, 2019 at 8:46:29 AM UTC+2, Sanjay wrote: > > His actual proposal paper is also an interesting read: > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0709r3.pdf. > This is fascinating read about language design in general and error handling in particular. Thanks for sh

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-09 Thread Nicolas Grilly
On Saturday, July 6, 2019 at 12:22:33 AM UTC+2, Jakub Labath wrote: > > Some of us had to fix so much broken java/python code with invisible and > anonymous goto statements (aka exceptions) that even just seeing the > keyword try prompts a physical reaction. > "Just seeing the keyword try prompt

Re: [go-nuts] Go += Package Versioning

2018-02-23 Thread Nicolas Grilly
On Fri, Feb 23, 2018 at 8:20 AM, David Anderson wrote: > The date+hash format is irritating to construct by hand, but could be > trivially lifted into a tool (perhaps even vgo itself). > Very true. I suffered from the same issue while trying vgo. This could be improved to ease the adoption of vg

[go-nuts] Re: Go += Package Versioning

2018-02-21 Thread Nicolas Grilly
I like this! One question: Some of us commit their `vendor` folder, to be able to build the project without any network access after the initial checkout ("offline mode"). Since the `vendor` folder is gone, is vgo able to manage and use a kind of `mirror` folder, which would contain the .zip a

Re: [go-nuts] Re: Ternary operator needed in Go

2017-10-18 Thread Nicolas Grilly
On Monday, October 16, 2017 at 8:37:25 PM UTC+2, Dave Cheney wrote: > > Prior to this recent post, this thread had been dormant for eight years. I > think the results speak for themselves and this topic does not need to be > revisited again. At least, it proves people are searching in the maili

[go-nuts] Re: Make error handling less verbose with Zig %% operator and %return expression?

2017-10-18 Thread Nicolas Grilly
On Wednesday, October 18, 2017 at 4:50:32 AM UTC+2, Bryan Mills wrote: > > There are lots of similar proposals in the issue tracker. > Of those, https://golang.org/issue/21161 seems to have the most traffic. > Bryan, thanks for the link. I wasn't aware of Ian's proposal. -- You received this mes

[go-nuts] Make error handling less verbose with Zig %% operator and %return expression?

2017-10-17 Thread Nicolas Grilly
I just read about Zig, a new programming language designed to replace C. The error handling philosophy is very similar to Go: control flow in general and error handling in particular is explicit. Zig has even a defer statement inspired by Go ;-) I noticed that Zig provides a %% operator and %re

[go-nuts] Compile-time parameters in Zig: a possible solution to generic functions and data structures in Go?

2017-10-17 Thread Nicolas Grilly
note we already have some kind of "compile-time feature" with constants. Nicolas Grilly -- 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

Re: [go-nuts] What dependency management tool do you use?

2016-07-18 Thread Nicolas Grilly
On Saturday, July 16, 2016 at 3:17:11 PM UTC+2, Peter Mogensen wrote: > > It's somewhat the same as we use: > * Don't use "go get" > * Have GOTPATH=${PWD} in project root. > * Have a /src directory in the project containing a link to project root > (often ../..) at the package name. > * Use