text stringlengths 0 2.35k |
|---|
**Jerod Santo:** Nice. |
**Kris Brandow:** Once you design a database driver, you spend a lot of time thinking about how to design an iterator really well, and then it just like sticks in your head forever. |
**Jerod Santo:** Gotcha. I did see a package recently that was trying to recreate JavaScript's Lodash, which is a lot of functional facilities for JavaScript, with Go's generics. It's a very fresh project, once generics shipped. I don't know if it's any good, or anything about it, except for I think people are gonna st... |
Last one, and then we'll get to wrapping up here... How long did it take you to get over if err!= nil being all over the place? |
**Ian Lopshire:** \[48:06\] I've never hated it. |
**Kris Brandow:** Yeah, I don't think it's ever bothered me. |
**Jerod Santo:** Never? |
**Ian Lopshire:** I like it. |
**Jerod Santo:** You like it? |
**Ian Lopshire:** I hate try/catch. |
**Jerod Santo:** You always liked it? |
**Ian Lopshire:** I did. Like, the first -- |
**Jerod Santo:** The first time you saw it, you're like "This is it." |
**Ian Lopshire:** "This makes sense." |
**Jerod Santo:** Okay. |
**Ian Lopshire:** I've always hated try/catch, because it's just so disconnected from where your error happens. You could catch something 12 nested levels deep, and just have no idea what's going on... So the idea that you just have to handle errors right where they happen - I just immediately though "Oh yeah, this is ... |
**Kris Brandow:** I think for me it's partly how I learned Go. I did not learn it trying to change some project from some other language into Go. I just learned Go to learn Go. I absorbed a lot of Rob Pike's talks, and things... And just like the idea that "No, errors aren't special; they're just other values." They ha... |
I think once I saw that, and once I started leaning into that as a signal that I should be getting from it, I wound up rewriting code and having it wind up be a lot better. So while sometimes it's annoying when you're prototyping and just trying to get something done, and you just write it a bunch of times, it's annoyi... |
**Jerod Santo:** So mostly what I see is -- and like I said, I've written like 200 lines of Go, so most of it is what I've read... Which is probably still less than a thousand lines, and then on the Go website, and stuff; most of it is like if err!= nil {return err;} Ain't that what most people do most of the time? |
**Kris Brandow:** Yeah, most people are doing that wrong. |
**Ian Lopshire:** Yeah. |
**Jerod Santo:** I was gonna say, isn't that not actually handling anything? Aren't you just passing it up? That's what I don't get. |
**Kris Brandow:** I think that's where a lot of the confusion from a couple years back came from, of like "No, you're actually supposed to handle your errors." You're supposed to -- |
**Jerod Santo:** Do something! |
**Kris Brandow:** ...think about what the problem is. |
**Jerod Santo:** If you don't do anything... It's like keeping the honest people honest. Like, you've gotta handle it right here. It's like, "Are you though?" It seems like you're just text-expanding that same snippet. |
**Kris Brandow:** I feel like a lot of the people that don't like if err!= nil don't like if because everytime they're writing if err!= nil {return err;}, and that's the only iteration of it that they see, and it's like "Well, that's incorrect." So you're using the thing wrong; you're not really getting the feedback yo... |
**Jerod Santo:** So that's hopeful. Mostly, that's what I've seen. I've always thought, "This seems silly." But that's probably because it's just doing it wrong. |
**Ian Lopshire:** A lot of times you do end up returning an error, but in those you should be adding context, you should be checking certain error cases that you can handle... But a lot of times you pass up the error for someone else to decide if they're broken or not. |
**Jerod Santo:** Because that's what you do for like a runtime error, right? It would just pass itself up until the runtime explodes. |
**Ian Lopshire:** Mm-hm. |
**Kris Brandow:** And I think too it's fine if you're doing that for just one thing. What people get frustrated by is when you have 100 lines of code, and 80 of them are just if err!=nil {return err;}. You have a high proportion of it. But once again, I think you've gotta go back and structure your code a little bit di... |
**Jerod Santo:** Well said. Okay, so this has given me new interest in that particular thing that has bothered me. It's like, "You know what - it doesn't have to be that way." |
**Break:** \[51:30\] |
**Jingle:** \[53:27\] to \[53:43\] |
**Jerod Santo:** Well, Ian, you are our guest today, so if you have an unpopular opinion, we would love for you to share it now. |
**Ian Lopshire:** I've been trying to think of one, I really have... I'm drawing a blank. |
**Jerod Santo:** Okay. Unacceptable... You shall say something. \[laughter\] No, totally cool. It's an optional segment. Kris, you are not hosting today, which means I defer to you. Have you thought of one? I mean, you've shared a couple; you got a little spicy there, but... What else have you got? |
**Kris Brandow:** There's so many spicy ones in my brain... Which do I choose from? |
**Jerod Santo:** \[laughs\] |
**Kris Brandow:** I mean, my one from last week was so spicy though... |
**Jerod Santo:** I haven't heard it yet, because we haven't produced that episode, but... I'm excited about it. |
**Kris Brandow:** I don't know, I'll go for one that's gonna be incendiary... I think it's time for Go to have a fork. |
**Jerod Santo:** Wow. Say more. |
**Kris Brandow:** I feel like it's time for Go to have a fork, because I feel like the community - we're not all together right now, and I think we're pretending that we are. Especially with things like generics, I feel like we've kind of fractured a little bit, and we should have a recognition of that fracturing... An... |
**Jerod Santo:** Where would the dividing line be? Would it be around generics, or are there other things? |
**Kris Brandow:** I feel like there's kind of the way that the language was when I first started learning it, which I guess is like the Rob Pike era of the language, where it was extremely practical of a language, and it was very focused on being a language for experienced software engineers that is still useful for th... |
**Jerod Santo:** Ian, your response. |
**Ian Lopshire:** Ahh... |
**Jerod Santo:** \[laughs\] Stake your claim right now... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.