text
stringlengths
0
1.82k
I started writing a blog alongside of the screencasts, did some longer screencasts... I think the longest one I did was like an hour. So I've just kind of been capturing all my thoughts, all my experiences, all my input that I'd gotten from people and the community... Just kind of trying to give back to the community i...
**Brian Ketelsen:** That's awesome.
**Erik St. Martin:** Now, talk to us a little bit about what the content is there. Is there a set structure where you're building on top of previous episodes, or is this more based on user feedback, questions you see around the web, and answering it in the form of video?
**Aaron Schlesinger:** Yeah, it's kind of both. I have my repo on GitHub, basically it's just all the issues or requests for screencasts. There's a couple in there to remind me to fix the site, or something, but almost all of it, the vast majority is people asking about, "Can I get a screencast on how to use the SQL pa...
\[03:49\] I try to make sure that each screencast has no prior dependencies. Some of the screencasts will be like, "If you have seen this screencast, it will help you, but you don't need it." But most of them are just like, you start at minute one and it takes you all the way through to the end. My goal is by the end y...
**Erik St. Martin:** I think this is really interesting. It's kind of along the same lines of the posts that Ben Johnson has been doing, kind of giving people little stuff to chew on for net/http or things like that, introducing people more to the standard library. I'm seeing that more and more as kind of like a patter...
I think that's building on kind of where we're at with the language too, because a lot of people are starting to get the syntax down, but now it's kind of idioms and learning their way around the standard library.
**Aaron Schlesinger:** Yeah. The standard library is so vast, and I feel like we're just scratching the surface, even now. And now it's growing, too. We just got context in Go 1.7, and that's crazy useful.
**Erik St. Martin:** I'm so happy about context!
**Aaron Schlesinger:** Yeah, me too.
**Erik St. Martin:** What I tend to do is I tend to be familiar with at least a base package, like "I'm gonna be doing something with bytes." Then, whenever I'm trying to do something new with it, I try to explore around and see what else is there, and be like "What is this?" Or like the io.TeeReader; you start tinkeri...
**Aaron Schlesinger:** Yeah, I think that's the hard part - imagining the use case before you've actually used it. And I feel like even still, there's kind of this chicken and egg, where if the community can't really nail down use cases, then the thing is not gonna be used, so use cases won't get developed out of the t...
**Erik St. Martin:** Yeah, I think I agree. I think learning is like that. You almost have to struggle first, so that when you're exposed to it, you have something to relate it to, where you're like "Oh wow, that would have been really useful when I had done such-and-such." But when you're first just coming across it, ...
**Aaron Schlesinger:** Yeah, for sure. I can't even count how many times I've written io.copy myself, and it's like an embarrassment now; it's like, "Come on, you should have remembered that." It's like THE function in the io package that you should always know. I just forget and I forget, and then all of a sudden, fin...
**Erik St. Martin:** You need to setup an io.copy jar on your desk, rather than a swear jar.
**Aaron Schlesinger:** \[laughs\] Yeah, I should.
**Erik St. Martin:** So talk to us about what some of the most popular ones are. Do you have ones that get exponentially more viewings and followings that others, or is it pretty scattered?
**Aaron Schlesinger:** \[07:41\] I think the number one by far is how to write a full stack web application, all the way from database access, down to serving up templates and writing JavaScript. That one was how to do it with just the standard library. I think that one had like 5,000 views after the first week. The re...
**Brian Ketelsen:** Hang on a second... You did that in five minutes?
**Aaron Schlesinger:** Yeah... That one was a huge hand-waving one. There is tons of code that I wrote beforehand, and I glossed over tons and tons of it in the five minutes. The code's all out there in the Go In 5 Minutes repo, so I heavily commented all of it, and wrote a bigger outline in the readme, like "Where sho...
**Erik St. Martin:** So this is more like kind of just starting the journey, getting enough seed planted and showing people where they can go from there.
**Aaron Schlesinger:** Yeah, for sure.
**Erik St. Martin:** How often are you releasing these?
**Aaron Schlesinger:** That's a great question. I started off every week, and then pretty quickly burned out, to be honest. I've been doing every two to three weeks now.
**Carlisia Thompson:** Aaron, I saw that you have an episode on the singleton design pattern, and on your repo you have an issue open for future "explain design patterns" episodes. And by the way, I wanted to mention to people that you have a repo where people can go and make requests if they want to learn about someth...
In any case, going back to the design patterns question that I have - how do you go about putting together a video tutorial for design patterns? Is it based on a lot of work that you have done with design patterns in Go? Or do you try to abstract how design patterns are implemented in other languages, and then sort of ...
**Aaron Schlesinger:** Yeah, that's a good question. Actually, I kind of do a mix. There are obviously some I've used in my own work, whether it's open source or at Deis; most of that is open source anyway. But I also look around, I ask around various... There's tons of Slack channels now in the Gopher Slack; so I eith...
I try to take from all three, but I wouldn't say I have a specific strategy or algorithm for figuring out where to take design patterns from and how to present them.
**Erik St. Martin:** \[11:58\] We had Dave Cheney on the show two episodes ago (episode 16) and we were talking a little bit about design patterns and how they came about. How do you see the design patterns as we know them in The Gang Of Four book applying to Go? What's your opinion on how they kind of fall in? Should ...
**Aaron Schlesinger:** I'd say technically of course it's possible, I think probably possible to do every single one of the Gang Of Four design patterns. But I think that Go simplicity is actually very powerful. I think Dave did a talk - it was either Dave or Rob Pike... One of those two, or maybe even both - they did ...
If you take a builder pattern, design pattern, something like that, and you bring it into Go, my goal is to try and explain why we should use it, instead of why we shouldn't use it. I would say from a cultural or community standpoint, I would rather not take a design pattern and write a little bit more code, rather tha...
**Carlisia Thompson:** Yeah, I can see that and I hugely agree with that. I did Java for quite a while and I knew Java fairly well back then when I was doing it. In the Java world - or at least in my Java world - design pattern was the go-to thing. It was pretty much like, there is a pattern, find out what it is and st...
**Erik St. Martin:** Well, that was kind of Dave's talk too, about the SOLID design, talking about single responsibility, open and closed, and the key points that will make software more maintainable, and then looking at design patterns as how they apply to that, whether they make things more complicated, and just reco...
**Aaron Schlesinger:** \[15:53\] Yeah. I think since I started writing Go, I kind of started to look at design patterns like just a recipe. If you're a cook, you wanna make an apple pie, you're gonna probably go to a couple different recipes to get the feel for how to make this pie; what's the general stuff that goes i...
I think that there's not just one builder pattern now in Go. I think that there's kind of, your mileage may vary, and some of the patterns work better for situations than others, and I think that's a great thing. That's evolution.
**Erik St. Martin:** Yeah, and I think we can look through the standard library and we could find examples of maybe like the visitor pattern... I think the hash sorting is done in a visitor pattern if I recall. We can find examples of that, but I don't think we necessarily have to bring everything over. I think as they...
So I think we look at our own problems differently, and I'm interested to see how we evolve with our own patterns, and we start to see some of these little idioms that people use, little tricks that are continuing to become commonplace in some of the more common libraries. I think if you look at most large projects in ...
**Aaron Schlesinger:** Yeah.
**Carlisia Thompson:** I think one downfall of design patterns, especially if you're doing something you don't have a ton of experience with and you set yourself to use a design pattern, is that let's say you're going to use a specific one and you might wanna do something that's a little bit out of that pattern, but th...
**Aaron Schlesinger:** Yeah, absolutely. If people can go back to that cookbook and say, "Oh, this looks pretty similar to visitor pattern..." The other thing I was gonna say, on your point, Carlisia, the Go programming language now is starting to give birth to concurrency design patterns that C++ and Java can't really...
\[20:01\] So it's even more important I think for people to be able to pick up things like the barrier pattern using WaitGroups and using Goroutines and then adapt to their needs. Because there's so many ways you can use that pattern, for example.
**Erik St. Martin:** Yeah, and I think we see stuff, you know, fan-in, fan-out, and things like that, that become so much simpler because we have the concept of the channels. It becomes so much easier to do things like that.
**Carlisia Thompson:** There is a talk by Rob Pike, it's called Go Concurrency Patterns. I've watched the whole thing before, and I was just gushing over it because it's beautiful. The patterns are beautiful.
**Aaron Schlesinger:** It really is.
**Carlisia Thompson:** Right? I'm sure you've seen it.
**Aaron Schlesinger:** I love that talk.
**Carlisia Thompson:** So yes, definitely, there are patterns for concurrency, and because at that point I had done concurrent code in Go, and I was just going "Oh my gosh, my code does not look like that at all", but I totally get it. I didn't memorize it, but my head was going "Oh, yeah!" So there are different ways ...
**Aaron Schlesinger:** Yeah.
**Erik St. Martin:** There was a talk at GopherCon 2014 too by John Graham-Cumming too, called A Channel Compendium, that had a lot of stuff like that, with some of the patterns with timeouts and things like that, with channels, which is also a really interesting talk to watch. And I wanna say Derek Collison's from tha...
So I know we volleyed back and forth a little bit on benefits and drawbacks, and not to be religious about design patterns... Many of us come from backgrounds where we had to heavily use design patterns, especially Java world, but let's kind of bring it in for maybe people who are more new to programming and Go is one ...