text stringlengths 0 1.82k |
|---|
**Erik St. Martin:** Yeah, and I think that... and Bill Kennedy is chatting here too. He pointed out the fact that this is supposed to be a temporary stop gap; it's not supposed to be a feature that people heavily use. It's supposed to allow people to put that alias and to not break CI for 20 projects that all depend o... |
**Nate Finch:** Yeah, that's what they say, but we all know that no hacks are ever temporary, right? They will stick around for years; that might be one of my concerns about this. |
**Erik St. Martin:** Yeah, I think it has a legitimate use, but I think that people are also concerned with... Go has done a very good job at removing the footguns, you know? This seems like one, and I think that's what heated the debate; it's really polarized. There's people who really need it for legitimate purposes,... |
**Carlisia Thompson:** Yeah, that's what I wanted to know, because one of the angles of the conversation was this is adding a level of indirection that's going to make reading code confusing. And the other side is saying, "Well, but you know, it's very useful, and guess what? We have *goto* as well, which is not suppos... |
**Nate Finch:** I think it's very valid to say that there are things in the language now which we say "Don't do that, except for very specific cases." Like using panics - you could use them exactly like exceptions, but then everyone will tell you that you're wrong. I do agree that as a community we seem to be pretty go... |
\[19:47\] I think this could be a similar thing. I think it could be abused, I am hoping that people won't. For most big code bases (like Juju) we review every line of code, so if someone was doing whacky stuff with this, we'd be like "No, don't do this!" But there are definitely times where it's very useful to be able... |
I think it's probably gone far enough, but they're not going to take it out. At this point, I think we have to be mindful of the way it's used. |
**Erik St. Martin:** And I think now is probably a good time for a sponsor break. |
**Break:** \[20:48\] |
**Carlisia Thompson:** Yeah, that looked really impressive. I was checking that out, that looked really cool. |
**Erik St. Martin:** Yeah, I was digging around in there, too. These are definitely things that when you're running their profiling tools you get this information, but you usually don't have it available to you once you kind of roll your app out into production. It was really cool digging around the web interface and s... |
**Carlisia Thompson:** Yeah, and that's sort of where it really counts, right? When a thing is in production is when you really wanna see how they are doing. |
**Erik St. Martin:** Yeah, you can only simulate so much in your test and CI environment. |
**Carlisia Thompson:** So going back to talking about how we are using Go in the most useful way of using the features that we already have - at least that's how it was playing in my mind... I know Nate wants to talk about error handling, and how the way Go does it is different and maybe even better than in other langu... |
**Nate Finch:** Yeah, sure. So it's funny... When Go 1.0 was announced which was actually the first time that I had heard of Go, and at the time I was working in C\# for the most part with some Java and Python, and I was like "Oh, it's a language from Google. I should go and see what it's like." And the very first thin... |
Exceptions are hard... Hard, hard, hard. In my last job was another big code base, I think somewhere around 50,000 lines of C\#, and I remember one instance where I was modifying some code and I was like "Oh, this code can fail. I'll have to throw in an exception." And during a code review, someone was like "You can't ... |
I remember one of the first Go programs that I wrote was just downloading a bunch of pictures off some website, and everything that could fail returned an error. It was this epiphany of, "Oh my god, I know what can fail. I can deal with all this, and I'd know exactly what my program's gonna do." I think dealing with er... |
Yes, you have to do "if error != nil, blah", but that's good, because that means you're saying, "I know this can fail. I'm gonna do something." |
People always talk about, "Oh, it makes my happy path look all messy", and I'm like "This is programming. There is no happy path." |
**Erik St. Martin:** Yeah, especially when you write network software, right? The amount of things that can go wrong is just... Anybody who's supported applications in prod is aware of stuff like that, the odd things that start happening to every application when different resources start hitting their level of saturat... |
**Carlisia Thompson:** That's very interesting, yeah. |
**Nate Finch:** Yeah, and the thing that I find is that in Go I'm a lot more aware of where things can fail, so instead of just programming for when things work, and then when things break everything dies... Things don't always work exactly the way I expect them do, and you have to deal with that. Things like the netwo... |
**Carlisia Thompson:** \[27:47\] That's a very good point. I remember when I started looking at Go open source projects, especially the bigger ones, like InfluxDB, Docker etc., I got really intimidated by how long the files were. I was just thinking, "Wow, it must take a lot of mental energy to hold everything that's i... |
Now I find that it's the opposite for me. I love it. I find it super simple. Whereas before I used to look at a big file and think I have to hold it all in my head, now I look at a big, long Go file and I think, "Everything is here. It's so much easier for me to hold this in my head, because everything is right here." ... |
**Erik St. Martin:** You know, the one thing that I like about it is if you use idiomatic Go, then your happy path typically is at the first indentation level, so if you're just trying to get an idea for what a function does, you can kind of just scan that level. And most of your edge cases and when things return an er... |
The hardest part is not knowing. It's the unknown unknowns, and I think that's why the whole crash-only software paradigm has kind of become more popular, especially with distributed computing and containers. And going back to Nate's point about people overusing panic, I wonder if it's that kind of crash-only methodolo... |
**Nate Finch:** I definitely think there are a large number of people that think that once you get into a bad state, that you no longer know what's going to happen, so you should just bail out. That's fine, but one of the ways you can avoid getting into a bad state is by understanding what can fail and how things are a... |
\[31:43\] In Juju, we actually have things we call "workers" that are threads, which will get restarted if they fare out. It's very similar to crash-only software just per goroutine. But I don't think you need panics to do that. Panic is taking down the whole application, and I think applications these days are complic... |
**Erik St. Martin:** I'll agree. You should allow the highest level possible to make that decision. You have some sort of RPC service, and there was some kind of network issue through jitter, like reordered packets that lost its state, or something like that; but you wouldn't crush the whole program. You would come bac... |
Bill Kennedy actually asked, speaking of error handling, what your views were on wrapping of errors, because there's a lot of polarization there too, where people think you should, so you can get more context and get stack information. Then there's also the other side of it - whenever you're wanting to handle errors, t... |
**Nate Finch:** Well, we actually use a wrapper in Juju that we wrote a couple years ago. In the beginning we didn't use a wrapper, and that does kind of make things rough. If you don't use a wrapper, then you do have to just compare strings, if you're using it to format that error off and then just adding on more stri... |
The nice things about this is that he gets a stack trace; when you make the new error, you can still get the error that was the original error, so you can still check and see if it's an io.EOF without having to look at the string. You can see if it matches some interface. |
Juju's package also lets you do that. All these packages work basically the same, and there's a lot out there. We've looked at a bunch, and I'm sure more have been written. |
Basically, they all just store the original error and give you back a wrapper struct that goes around it. The problem with Juju is that you have to wrap it at every return, because instead looking at a stack trace per se, it marks where it gets wrapped on the return path up. The idea was that if you pass errors over ch... |
The difference with Dave's is that he actually grabs the stack trace the first time, so in theory you don't actually have to wrap it when you return it past that first time. So I think they're kind of good, and I think they're kind of not as useful as people think. In Juju, a lot of the time I can just search for the s... |
**Erik St. Martin:** \[36:07\] Yeah, I typically only want the stack trace if I don't know how to continue. If I know how to recover from the error, I don't really care about the stack trace, but when I'm actually taking down the application because I don't know how to recover it from the state, that's typically where ... |
**Nate Finch:** Yeah, and I just haven't seen as much use out of the stack trace as I would like; it seems like a lot of work -- not really a lot of work, but more work for questionable benefit. So I'm still leaning towards saying it's a good idea, but it's not as strong as I would like. I'm not exactly sure how to mak... |
**Erik St. Martin:** Okay, so I think it's about time for our second sponsor break, and then I wanna get into some projects and news, especially with the 1.8 freeze going on. |
**Break:** \[37:03\] |
**Erik St. Martin:** So next up, projects and news. So we have the 1.8 freeze - that just happened, and we're gonna be frozen for three months, right? |
**Nate Finch:** Yeah, I think so. |
**Erik St. Martin:** So I wanna talk about some of the stuff that's coming in there. We talked about one of them, which is the aliases, but there's some other stuff coming in, like they're leveraging the context package a lot more. One of the cool things I was interested in is the database SQL package will have cancela... |
**Nate Finch:** Yeah, I was looking at it, too. They've done a bunch of stuff with names and parameters and stuff. They're really puffing it up a bunch, because it was a little bare bones before, and it's nice to have people to do a lot more things. That's half of what most applications do - talk to a database. |
**Erik St. Martin:** Yeah, that's true, I don't know how much love I've seen in the database SQL package since early 1.0 release. It may just be because I haven't been looking for it, but I don't think a lot more functionality has been added to it, to my knowledge. One of the other cool things is the HTTP package - the... |
**Nate Finch:** Yeah, that is very cool. |
**Erik St. Martin:** And then they're gonna be doing the reverse proxy will have HTTP2 support. Nate, I hadn't seen this, but you had mentioned something about dynamic plugins. |
**Nate Finch:** I think that's coming in 1.8. |
**Carlisia Thompson:** Yeah, it is. |
**Nate Finch:** Okay, good. Dave and I have been working on this for a long time, being able to compile code as a plugin that can be loaded by other Go code. The other main application loads it using -- there's a new plugin package in the stdlib on [Tip](https://tip.golang.org/), and... It basically works like plugins,... |
**Erik St. Martin:** \[40:09\] So this is basically loading it as a dynamic library, like a DLL or an .so file, for other languages. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.