text
stringlengths
0
1.49k
**Erik St. Martin:** You have to shift them from "Not safe for work" to "Somewhat safe for work."
**Mark Bates:** Okay, I'll just substitute anything bad with the word Belgium, and we should be fine. \[laughter\]
**Brian Ketelsen:** And then Belgium! Yeah, this is gonna be a good show, folks.
**Carlisia Thompson:** Let's get to it, because I am dying to know what it is that it is the big secret!
**Brian Ketelsen:** Oooh, the big secret...
**Mark Bates:** Oh, the big secret. Well, I can't talk about the big secret.
**Carlisia Thompson:** Oh, come on! I thought you came on the podcast to talk about the big secret.
**Mark Bates:** I did, and then yesterday the big secret got even bigger and better...
**Brian Ketelsen:** Way bigger...
**Brian Ketelsen:** Yeah, than I could have ever imagined it would, and so we have to not talk about the big secret today.
**Erik St. Martin:** But there is something really cool to talk about, that a lot of people may not already be aware of, which is your new project you've been working on.
**Mark Bates:** Yes, we can talk about Buffalo. GoBuffalo.io... Till the cows come home. Or till the buffalos come home anyway.
**Brian Ketelsen:** Till the buffalos come home, that's right.
**Mark Bates:** \[laughs\] That's right. I'm very excited about Buffalo. That, I definitely wanna talk about, because it's some pretty cool stuff, I think.
**Brian Ketelsen:** So why don't you start by telling us what the hell Buffalo is?
**Mark Bates:** Besides just a terrible name for any project, Buffalo is another web framework in Go. I use the word "another" because there are a collection of them out there. This one aims to be slightly different in that I have decided not to reinvent the wheel that a lot of these frameworks have invented, but inste...
**Brian Ketelsen:** \[04:18\] \[laughs\]
**Mark Bates:** That five-letter word that no one wants to talk about.
**Erik St. Martin:** When I first heard about Buffalo, my first thought was the xkcd Standards comic, you know? Like, you have 14 computing standards. Ridiculous! We need to develop one!
**Mark Bates:** A 15th, yeah.
**Erik St. Martin:** So what was the motivation for creating another web framework?
**Mark Bates:** That's a great question. The Why has haunted me for a while, I wanna write a blog post about the Why. I have, over the years, tried some of the big Go frameworks, and I'm not gonna name any names, and I don't wanna poop Belgium on anybody's framework...
**Brian Ketelsen:** We're not shaming anybody!
**Mark Bates:** Exactly. So I've tried a lot of them, and the biggest problems I found with a lot of them is a) they're not idiomatic Go, b) they're too complex, c) they don't think of the problem holistically; they don't start you off right from the beginning with "Here's a generated base of things to work with. Just ...
That's really what I was looking for, and that's kind of how Buffalo came to be. It was years of me curating these packages and building essentially a Buffalo for every single web app I've developed in Go. I got sick and tired of doing that, so that's kind of how Buffalo was born.
**Brian Ketelsen:** So would it be accurate to say that you took the best of all of the packages that exist out there, sprinkled in some SuperGlue and turned it into what you're calling in air quotes a framework?
**Mark Bates:** \[06:09\] Yeah, that's about right. If you look at the core Buffalo package itself, most of it is just glue code. There are a handful of sub-packages to other things, like provide basic rendering frameworks... You know, that could be extended using a very simple interface, and stuff like that.
I found a great router, for example - the gorilla/mux router is a great router. Great, let's wrap that. Let's wrap then the ability to add some nice middleware on it, an easy to use declarative syntax, a context structure, the ability to skip middleware, which nobody really does, but very useful... So that sort of glue...
And even things like the asset pipeline; I just pulled in Webpack and set up Webpack for you and made it kind of all work. So just taking the best of all those worlds.
**Brian Ketelsen:** What is an *asset pipeline*? Can you explain that for people like me who don't know a damn thing about the web?
**Mark Bates:** \[laughs\] Yeah, I know that because I've tried to help you with it several times.
**Brian Ketelsen:** Aww...
**Mark Bates:** \[laughs\]
**Brian Ketelsen:** The pain!
**Mark Bates:** I know. I love you, Brian, but you... I thought I was bad at frontend work, but... \[laughs\]
**Erik St. Martin:** We won't shame web frameworks, but we will shame people.
**Brian Ketelsen:** Yeah, apparently shaming Brian is perfectly okay.
**Mark Bates:** \[laughs\] I've got a document saying to shame Brian, from Erik. Was I not supposed to do that?
**Brian Ketelsen:** Oh, I didn't get that.
**Carlisia Thompson:** You're fine, that's another document, Brian... We have it on \[unintelligible 00:07:34.20\] \[laughter\] You're fine, Mark, go ahead.
**Mark Bates:** So an *asset pipeline* is a term kind of coined from the Rails world. Essentially, it is a build system around your JavaScript, your style sheets and your images and the like. In the Rails world they do it all on Ruby and it's painfully slow and difficult to use. In other worlds, they use tools like Web...
\[08:07\] So I pulled that in, and the nice thing about that is by using something like that you can develop ES6 right out of the box with Buffalo. You can use SASS stylesheets right out of the box with Buffalo. The Buffalo dev command does hotcode reloading of both your Go app and your asset, so as those change, it re...
The Buffalo build command will build up a binary of all of your code - your Go code, your assets, your migrations, everything in one single binary. It's pretty slick stuff, I think.
**Brian Ketelsen:** Wait, wait, wait... Go back for just a minute. Did you say that you bundle all of the assets and the migrations directly into the binary?
**Mark Bates:** Well, yes I do, Brian. I did say that.
**Brian Ketelsen:** That is freakin' amazing!
**Mark Bates:** It is. It's one binary to rule the world, as I like to say.
**Brian Ketelsen:** How do you enable such magic?
**Mark Bates:** \[laughs\] Through the power of code generation, Brian. Yeah, there's definitely a lot of magic going on. All I would say is if you follow "the Buffalo way", if you generate a stock Buffalo app and you use it as such, and you use the Acid pipeline and the way the folder structure is set up for you and e...
It really is beautiful. It's been one of my biggest pain points in Go web development over the years.