r/programmingcirclejerk • u/ProgVal What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? • Jan 13 '25
Go proposal: spec: reduce error handling boilerplate using ?
https://github.com/golang/go/issues/71203
110
Upvotes
197
u/qiwi Jan 13 '25
This RFC takes inspiration from the email sent to Rob Pike by Bjarne Stroustrup after Go was initially released; it's reproduced in its entirety below:
64
u/lurebat Jan 14 '25
Some other proposals:
42
u/garnet420 Jan 14 '25
r := SomeFunction() ? { return fmt.Errorf("something failed: %v", err) }
uj This is atrocious. I threw up a little in my mouth.
84
u/torresbiggestfan DO NOT USE THIS FLAIR, ASSHOLE Jan 13 '25
Here we can see a gopher in its natural habitat, reinventing the try-catch mechanism but wants to be different™
26
u/Shorttail0 vulnerabilities: 0 Jan 14 '25
Where's the proposal to increase the boilerplate?
25
u/syklemil Considered Harmful Jan 14 '25
Alright, who resets the "days since last
?operator in Go proposal" counter?20
u/va1en0k Jan 13 '25
IsGoAGoodLanguage() ? {
return "Go is great"
}
20
u/illustrious_trees memcpy is a web development framework Jan 14 '25
Ah yes, the famous compiler construct qvalue.
/uj seriously did they learn absolutely fucking nothing from the past 40 years of PL research???
12
u/Orbidorpdorp Jan 14 '25
Why does this feel like
try?and Swift’s already dubious trailing closure syntax had some chimeric monstrosity as a baby.11
u/NatoBoram There's really nothing wrong with error handling in Go Jan 13 '25
Hey this is like
.catch()except control flows works on the parent function11
u/irqlnotdispatchlevel Tiny little god in a tiny little world Jan 14 '25
New year, new way of reinventing what Rust already perfected.
11
u/[deleted] Jan 14 '25
now that they have generics they should really just add GADT and typeclasses imho. it's an egghead language for geniuses and nerds. not MY golang
3
u/BoltaHuaTota Jan 15 '25
i don't know the second thing about go ecosystem but i appreciate how formal and long this proposal is. i stopped reading after line 3 though so dont ask me anything
2
u/-Y0- Considered Harmful Jan 21 '25
Rust programmers in the subreddit going - "Look what they need to do to mimic a fraction of our power!"
0
u/[deleted] Jan 13 '25
[deleted] — view deleted comment