Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hot_gril
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
38 ms
·
481.
▲
by
hot_gril
2y ago
errcheck seems very sensible.
482.
▲
by
hot_gril
2y ago
Adding a try{...} with an empty catch{} takes a lot more effort than simply forgetting to do something with an error return value.
483.
▲
by
hot_gril
2y ago
Try-catch is awful if you're forcing it in a language that doesn't really support it. I provided a JS try-catch example above; is there something wrong with it? The recover is still function-wide in your example, which is what I s
484.
▲
by
hot_gril
2y ago
Well ok, you can draw the similarity in how they both automatically bubble up. But the catching behavior is different, and they look different. Overall they weren't designed for similar uses.
485.
▲
by
hot_gril
2y ago
It's different syntax, less convenient, and less obvious what you're try-catching. Also you can't scope it to just part of the function. func outer() { defer catch() { if r := recover(); r != nil {
486.
▲
by
hot_gril
2y ago
It's a problem for values of all types, which is why exceptions are usually handled specially in other languages. I get that it seems impure, but everything you call has some way to fail <1% of the time that you probably want to han
487.
▲
by
hot_gril
2y ago
What's imposed on a Golang user is two choices, panic/recover or regular error handling, and almost always you take the latter. There's no option of using exceptions the same way you would in most other languages.
488.
▲
by
hot_gril
2y ago
Golang programmers indeed don't prefer panic/recover, but that's not comparable to exceptions in other languages.
489.
▲
by
hot_gril
2y ago
I understand how to use them in Golang, it's just annoying to have to keep checking and returning errors everywhere.
490.
▲
by
hot_gril
2y ago
Since the boat has already sailed for Golang having async/await from the start, adding it now would require maintaining compatibility with uncolored functions. Waiting for a channel to have data from a go func is similar. JS has simila
491.
▲
by
hot_gril
2y ago
This is confusing, so I'll put it this way, Golang doesn't have exceptions the way someone coming from Javascript, Java, Python, ObjC... would understand: thrown anywhere and automatically propagated up the call stack unless caugh
492.
▲
by
hot_gril
2y ago
That's right. So if Golang wanted to do async/await, it would probably be in a fully parallel way.
493.
▲
by
hot_gril
2y ago
async/await is just syntax. There's nothing saying that two async calls can't run fully in parallel. "Blocking" is subjective too; in a way even JS is doing some parallelism.
494.
▲
by
hot_gril
2y ago
Golang should have async/await and exceptions, both of which can be implemented as syntactic sugar on top of existing features.
495.
▲
by
hot_gril
2y ago
They supposedly use trip info for their own advertising. Says also "in some cases" shared with third parties for ads. "We collect usage data that includes trip history, buttons or links you click on our mobile app, in-vehicle
496.
▲
by
hot_gril
2y ago
It's legal to fly with guns in checked bags, but I don't know the specifics of the interaction with the driver.
497.
▲
by
hot_gril
2y ago
I don't agree with this, but gotta hand it to them, the WWE thing is funny and well-done.
498.
▲
by
hot_gril
2y ago
Whatever it costs now, it could be cheaper later.
499.
▲
by
hot_gril
2y ago
Regardless of whether the Waymo is supervised, they're brand-new cars, of course they'll be cleaner.
500.
▲
by
hot_gril
2y ago
Was there a law against being armed in the airport dropoff/pickup area there?
501.
▲
by
hot_gril
2y ago
Yeah, I've ridden with two cool drivers with history degrees, one jazz musician from Ethiopia, and one who I'd already met elsewhere. Zero interest in riding in a Waymo. (Disclaimer: Alphabet shareholder)
502.
▲
by
hot_gril
2y ago
I rode BART for a year, every day something bad happened
503.
▲
by
hot_gril
2y ago
Invert colors, hold shift to slow down expose animations, spam F11 was what kids did when bored in computer lab
504.
▲
by
hot_gril
2y ago
I remember there being dev mode and also a glitch, but I could be wrong and don't have a Tiger machine to test with now.
505.
▲
by
hot_gril
2y ago
He mentions the old Dashboard ball widget. There was a glitch you could use to put widgets onto your desktop instead, so naturally every school Mac had 20 bouncy balls on it.
506.
▲
by
hot_gril
2y ago
I took Lion King to mean not to take your family for granted, and I'm fine with it. The other Disney prince/princess movies don't really have messages other than "you can have your cake and eat it too." Like, whenev
507.
▲
by
hot_gril
2y ago
I agree for reading. The example of Cinderella's sisters chopping her feet isn't too much for a child to read about, but nobody wants to watch that in an animated film. There's also a point where books become unsuitable for c
508.
▲
by
hot_gril
2y ago
The only thing I seriously plan to use Golang for is implementing a scripting language in my spare time. Its threading model (greenthreads flexibly mapped to OS threads) is attractive for that.
509.
▲
by
hot_gril
2y ago
It's been a long time since I've used Oauth2, and I don't remember how it works, I only remember pain.
510.
▲
by
hot_gril
2y ago
Yolo pumping out code for a programming language or tooling I'm unfamiliar with, either to use as boilerplate or learn from as an example.
More ›