Chris Penner, Author of Optics By Example: Functional Lenses in Haskell
A Leanpub Frontmatter Podcast Interview with Chris Penner, Author of Optics By Example: Functional Lenses in Haskell
Chris Penner is the author of the Leanpub book Optics By Example: Functional Lenses in Haskell. In this interview, Leanpub co-founder Len Epp talks with Chris about his background, how he got into programming, how he specifically got into programming in Haskell, moving to work for a time in Berlin, why a monad in Haskell is like a "program...
Chris Penner is the author of the Leanpub book Optics By Example: Functional Lenses in Haskell. In this interview, Leanpub co-founder Len Epp talks with Chris about his background, how he got into programming, how he specifically got into programming in Haskell, moving to work for a time in Berlin, why a monad in Haskell is like a "programmable semicolon", what "optics" are and a bit about their history, his book, and at the end, they talk a little bit about his experience as a self-published author.
This interview was recorded on July 7, 2020.
The full audio for the interview is here: https://s3.amazonaws.com/leanpub_podcasts/FM160-Chris-Penner-2020-07-07.mp3. You can subscribe to the Frontmatter podcast in iTunes here https://itunes.apple.com/ca/podcast/leanpub-podcast/id517117137 or add the podcast URL directly here: https://itunes.apple.com/ca/podcast/leanpub-podcast/id517117137.
This interview has been edited for conciseness and clarity.
Transcript
Len: Hi I'm Len Epp from Leanpub, and on this episode of the Frontmatter podcast I'll be interviewing Chris Penner.
Based in Saskatooon, in the Canadian province of Sasktachewan, Chris is a software developer who is currently working for Vendasta, which helps local businesses get online and build monthly recurring revenue.
You can follow him on Twitter @chrislpenner and check out his website at chrispenner.ca.
Chris is the author of the Leanpub book Optics By Example: Functional Lenses in Haskell, "a one-stop comprehensive guide to mastering optics in functional programming languages" for everyone from complete beginners to those with advanced experience.
You can follow the Twitter feed for the book at @opticsbyexample.
In this interview, we’re going to talk about Chris's background and career, professional interests, his book, and at the end we'll talk about his experience using Leanpub to self-publish his book.
So, thank you Chris for being on the Leanpub Frontmatter Podcast.
Len: I always like to start these interviews by asking people for their origin story, and I was wondering if you could talk a little bit about where you grew up, and how you first became interested in programming.
Chris: Sure, love to. I was lucky in the sense that I've had a computer in the home for a very long time. My father actually was a part of IT, he helped run the servers for a local college campus. And so we always had computers at home, so that he could work from home from time to time - and we just had computers around from a very young age.
I actually, surprisingly, didn't take after my father in a lot of ways. He didn't really bring his work home with him, so he just kind of let me approach them in my own way.
But of course I started with video games and that sort of thing, right? You just develop that familiarity and comfort with them.
So when it came to high school, I of course was very comfortable online, and did all the online forums and whatever else teens get up to. I got pretty into programming from, I think, grade 10 in high school. I was already doing some programming, and I would program some of the answers to my math assignments and science assignments, and that sort of thing.
So I knew about that time - grade 10, grade 11 - that programming is what I wanted to do with my career. I found myself very lucky that I knew at such a young age, and just kind of took it from there. There's a couple of changes along the way, right? But that's when I knew I wanted to be a programmer.
Len: And did you study Computer Science at university?
Chris: Yes I did, actually. I have a little bit of an interesting story there.
By the time I started university, I already had done a fair amount of programming on the side. I'm very much self-taught in my origins, and I learned a lot at that point. And so actually after my first year or university, where I had just done some prerequisites and the math, art, sciences, English, that sort of thing - and I had already picked out where I wanted to work when I was finished university.
I found them at a career fair, and I said, "Oh hey, what sort of work do you do? What sort of tools do you use?" I found out actually at the time, this was - the company, Vendasta, that I'm still at now - even though I left and came back a couple of times in-between - it was quite interesting, because they told me straight up, they said, "Oh, we use Python and Google App Engine and this is the sort of work that we do." I said, "Okay, great."
I went and I spent the summer after my first year of university - and I learned their tech stack, I built some little tools and some little toys with that - and I came back the next year, and I said, "Hey, I want to work with you guys. Can you get me an interview? I'd love to be a summer student. I know that that's not something that you traditionally have done." They didn't really have a summer student program at the time. But I said, "Give me an interview, we'll see - I've been experimenting and learning and trying to get into this.' They were kind enough to give me an interview, and hired me on as a summer student - and they've had a summer student program for a couple of years since then, and it all worked out.
Len: And did you work in Berlin for a while?
Chris: That's correct. That was right before I started work on the book, actually.
I guess I'll go back to my journey into Haskell as well, because it plays a key role in that transition that I took.
So Haskell is - for those listening who aren't really familiar - I won't get super deep into it, but it's more of an esoteric programming language. It's a little bit more rare. You won't see most companies list it as something that they work with regularly. And it was something I got into during my fourth year of university.
I had already been working at Vendasta for a few years at that point, and so I had a little bit of production experience. I was honestly getting just a little bit bored with my university time.
So I decided to take up some Haskell in my spare time and just see - I saw people talking online and saying, "This programming language will change the way that you think about programming." And that - for better or worse - sounded interesting to me. So I gave it go.
I spent about that next year just learning Haskell in my spare time, and I actually ended up building a text editor in Haskell - that was my first project, that was a lot of fun.
Eventually over the years, I kept coming back to it. I would work in Python or the Go programming language. And then in my spare time, I would be hacking on Haskell, and very interested in how that works, and interacting with the community.
Eventually I decided, "This is super fascinating. I have to give this a go. I have to see what's the day-to-day like? What it could be like programming this for a day job." So that was when I started looking for opportunities to do that.
As I said, so Haskell is a little bit esoteric. There's not too many companies using it, so I did have to search for a little bit, and I eventually found Wire, which is the company that I worked for in Berlin.
It's a very cool company. They do end-to-end encrypted chat applications. They have mobile apps and web apps and desktop apps, and it's all very secure, end-to-end encrypted. So Wire can't read any of your messages, anything like that.
I thought, "Well hey, this is an application that I agree with - the principles behind it, and I think I'd be interested to work with this team. And it turns out, they're all open source, and they use Haskell for everything. This is a great opportunity."
I sent them a message, and we ended up doing some interviews and flying me out there for a bit - and it was a good fit, so I moved out to Berlin and wrote some Haskell in Berlin for a little bit, and met some awesome people there.
Len: A lot of Leanpub authors are people who've moved around a lot, or people who aspire to move around a lot. I'm curious, what was the process like for actually getting to work in Germany? Did Wire just take care of everything and their lawyers, or did you have to make a special trip to Ottawa or something like that?
Chris: For me, actually it was pretty easy, I would say. Part of that was, I was very careful to make sure I got my degree. That makes it much easier. If you have a Computer Science degree, many countries in Europe, Germany being one of them, will effectively-- you don't have to prove that the job couldn't be taken by a local resident, right? Some visas, they have that requirement - and in this case with Computer Science, it's a much simpler process.
They thankfully also got in touch with a local relocation company. They booked all of the meetings with the local authorities, with setting up the visa - all of that. And luckily, actually - being Canadian, I have a temporary visa just built in, right? I can go to Germany for X amount of time. And so we were able to move to Germany and get my permanent visa while I was there on my temporary visa. So, it was actually quite easy, and Wire and the relocation company took care of all that.
Len: That's a really great story, thanks for sharing that. I went through something similar a couple of times in my life, moving around - and it's always interesting to hear the details. And I can say, having your company’s lawyers handle everything, and having their team handle everything, is a very different experience from doing it yourself.
Actually, one thing that I commonly like to ask people on the podcast is - there are many people who got into programming through Computer Science, studying Computer Science formally. And there are people who got into programming who are just self-taught on their own.
I always like to ask them - if they did it one way, do they regret not having done it the other way? I guess part of your answer is probably going to be, "Well it helped me get into Germany, so I'm pretty glad I got a Computer Science degree." But do you ever regret having studied formally at university in Computer Science for a few years?
Chris: This is a bit more of a nuanced question, which is great. What I would say is that if I were to just get an industry job, I wouldn't necessarily say that the university education is the best way to get there. I definitely learned a lot through my university education, they teach you lots of things. But I found that - at least at my local university, the University of Saskatchewan here in Saskatoon - they do tend to lean towards a more academic Computer Science education, rather than - most of the jobs that I've had are writing apps and building software, right? It's not so much research here.
So the main reason that I actually did finish my degree, was I knew that maybe someday I would want to travel, or maybe want to do a Master's somewhere or travel somewhere, and having a degree would be very helpful for that.
But at the same time - I would say that the final years of my university, I learned about lots of interesting things. I was exposed to compilers. I was first exposed to Haskell at university. I learned all about regular languages, classism, and things like that. And Big O complexity, and all of these things. Which, certainly you can learn on your own - but you're not going to be exposed to such a large breadth of them all at once, if you don't have a reason to go digging into them, right?
I was luckily exposed to all of these things. And Haskell is actually - it was invented as a research language. It was invented in universities, and it's a language which is based on mathematics and academia.
And so moving into Haskell, which is what has influenced this book, and my path since then - having these formalisms in mind, really, really helped me feel more at home as I was learning. It was still difficult, but it made it much easier.
Len: This is just my last question about this - did you study math as well? Because I've seen - I watched a couple of your talks on YouTube and your explanations are often very math-heavy, in a way.
Chris: Yeah. So actually, this is quite interesting. I didn't have much interest in math in university. At least not the pure mathematics, and I took physics and those sorts of things. I took all of the standard math classes - physics, chemistry, and then the introduction to maths or calculus. I did a little bit of [?] algebra and those sorts of things.
The closest I got to the stuff I really ended up finding an interest in, was I took an abstract algebra class. And I found it really interesting, but at that time I just didn't see any applications for it - other than getting into mathematics research, right?
It actually took a year from the time that I had taken that class - and I'd taken some number theory classes too, to start to realize, "Oh, Haskell is actually a programming language which is based on these ideas from abstract algebra and category theory." I hadn't seen any of that in any other programming language.
So you look at a traditional Go lang or even C or Java - all of those, they have a legacy, they're built on - well, most languages are very heavily influenced by C and it's successors, right? But they're not based on hundreds of years of mathematic history, right?
And so there's a richness there that you can start to realize, "Oh, we can express patterns, not just mathematic patterns, but actually patterns of computation using this abstract algebra." And so that's where I really, really got hooked into it, when I started to see, "Oh, every business problem you've ever had - it's a math problem with a fresh coat of paint on it. So if you can fill your head with enough of these sorts of mathematic formalisms and shapes -" And this is where I was really, really fascinated. Because it combines the fields of mathematics with programming.
And if you think about programmers, what's one thing that we're really, really good at? We're good at abstraction. That's what we do all day long. We practice abstraction. We're writing functions, we're using polymorphism, we're implementing classes and interfaces.
When we can combine that abstraction onto these mathematic interfaces, we can start to apply these mathematic interfaces to these business problems. And if you use this math concept that's been around for 200 years, there's a good chance the kinks are worked out already. So if you can just make a tweak here and a tweak there, and now it solves your business problem, then you save a lot of time.
Len: Thanks very much for sharing that. You're reminding me. I've interviewed a few people on the podcast who are Haskellers. And they are there's something, there seems to be something that's thematically similar about the things they're attracted to in their own thinking. And I believe, I hope I don't get this wrong - but it was Julie Moronuki, whose path into it was through linguistics.
Chris: That's correct, yeah.
Len: And we've also interviewed Sandy Maguire too - who, I don't know if we talked about Haskell, but I know he helped with your book a little bit. You put him in the acknowledgements, if I'm not mistaken.
Chris: Yeah.
Len: Just the way my mind works - is I view it as like, it's people with a philosophical interest in what they're doing, who seem to be attracted to Haskell.
Just before we move onto the next part of the interview where we talk about your book, I would like to ask you a little bit about the pandemic. One thing I always like to say on the podcast, is that one of the great pleasures of it is that I get to talk to people from all around the world, and ask them about things that are going where they're from, that might have been in the headlines.
For the last couple of months, that question has been, "How has the pandemic affected you?" In this case, it's a particular pleasure for me to ask how it's affected things in Saskatoon, because as long-time listeners of the podcast might know, I'm from Saskatchewan, and I actually am from Saskatoon. I took "Intro to Calculus" at the University of Saskatchewan myself, many moons ago. And so, I was wondering if you could talk a little bit about how the pandemic has affected you, and how it affected the city of Saskatoon?
Chris: Sure. I was very surprised to hear that you've been around Saskatoon, Saskatchewan, because most people - I mention that when I'm overseas in Berlin, and they say, "Where are you from?" "Saskatoon, Saskatchewan." And they just think it's a joke. You can't say that ten times fast. But luckily you can pronounce it correctly, so that's wonderful.
The response in this area - Saskatchewan is unique in that we have quite a low population density in, so I think - I'm not a scientist who studied this - so take, of course, my word with a grain of salt. But I think that that's allowed us to perhaps have a little bit less of a drastic need for an incredible response here. But I'm quite happy with how things have gone. We did have a very strong, "Okay, everybody needs to stay in their homes and self-isolate", right off the very beginning." And it seems to have had the desired effect, so far as I can tell.
After a couple of months of working from home - I'm actually still working from home. And I'm very thankful that with my job at Vendasta, I can work from home here. I'm actually just a couple of blocks from the office, so it wouldn't be a huge deal if I needed to go back in. But that's been very, very nice.
I would say overall, I think we currently have somewhere around the area of six known active cases in Saskatoon, out of 270-some thousand people. So as far as those numbers go, I'm pretty optimistic about how we're doing.
Len: That's great to hear, thanks for sharing that. It's funny for me to hear that number - that means Saskatoon is like twice as big as it was when I lived there.
Just moving onto the next part of the interview, where we're going to talk about your book Optics By Example: Functional Lenses in Haskell - I'm going to ask you the Haskell question I ask everybody, which is, what's a monad?
Chris: What's a monad, right? I'm sure you've got, "a monad is like a burrito," right?
Len: A cat in a burrito.
Chris: One of the answers to that - I won't spend too much time on this anyway, we have other things to get to - but it is - the analogy that I really, really like is the idea that it's a programmable semicolon. Not sure if you've gotten that one before?
Len: No.
Chris: So when you think about monads, they're actually originally invented in Haskell, in order to express the idea of sequencing. So do this thing, and then do this other thing. Because in traditional mathematics, that's - not really possible, everything is just expressed as these rules, and everything happens at once, right? There's no state of the world in mathematics, right? So we don't need to worry about that.
But when you're programming, it really does matter whether you write to disk first or read to disk first, right? We need to sequence those in the right order.
And so monads were invented to, at the base level, allow us to say, "Okay, this thing happens and then this thing happens." But they're an abstraction.
So, I've talked a lot about mathematic abstractions. And monads right there - they're more of an interface, and you can have multiple different types of monads. And some of them deal with sequencing, but others of them do other things. But they all tie these ideas of these expressions or these statements together.
And so you can actually write very, very interesting monads, which affect how your program is glued together. Your program can accomplish many different things, without needing to - you can change the program's behavior after the fact, without needing to affect your syntax. And it's been very, very interesting to see all of the domain-specific languages and VSLs that come out of this idea, and how powerful it can really be.
Len: Thanks for that. A programmable semicolon - that's a great image - I've got a background in English, so that one's going to stick with me maybe more than some others.
So, moving onto the next part of the interview, and finally talking about your book Optics By Example: Functional Lenses in Haskell. What led you to write the book?
Chris: Yeah, so you mentioned actually - a little bit earlier. I think you had him on to talk about his book Thinking with Types, and so, I actually - I originally met Sandy back in a Slack channel, a functional programming Slack channel. We were chatting in there for a good couple of months. And at some point after he had released his book, we were chatting - and he just mentioned some things about the book.
I was a little bit curious about it, so I prodded him about it. And he was very open and forthcoming, he was like, "This is how it's going, this is how it's been, this is what it was like to write a book." He posts a lot about how he lives his life online. He's got a blog about some of the experiments he's taken and some of the things that he's tried.
And part of it was just that his lifestyle was appealing - the idea that he didn't work a day job, and that he could write on his own time, and just kind of - if he feels like writing today, he would write today - and if not, he can go for a walk in the park, and that's really a cool idea for that sort of thing.
He showed me that this was an attainable thing to do, and that someone with - I think of himself and I, right? We don't have Master's degrees, we don't have Ph.Ds right? We're just people who got excited about a thing and then thought about it a lot, and then wrote a book. He showed me that that's possible.
And so what ended up happening actually was - after I had been in Berlin for a little while, and I decided to leave the company there and come back to Saskatoon for a bit, right before I was leaving, I did a talk at a conference there called, "Monadic Party." It's like a week-long Haskell summer school. It's an extended conference. They have lots of speakers come in. I did a talk there on mathematic abstraction called comonads.
I got to meet a lot of really cool people there, and just chat about Haskell for about a week straight. I realized something - that I love optics and what they - we'll get to that soon, I'm sure - and what they can accomplish, and what they can do and how expressive they are.
And so I was talking with all sorts of people about it, and I realized that, "This is a hard thing for people to get into, but it really does pay off." I had several people encourage me and say, "Hey, Chris - I enjoyed your workshop, you're a good teacher. Why don't you teach this? Why don't you teach optics" And I thought, "Oh, okay - well, maybe that is something I could do?"
So when I ended up leaving that conference, I thought to myself - things have been stewing around in there enough, it's like, "A book is viable, and maybe I'm the one to write it?"
And I was lucky enough that - well maybe - it was quite interesting that there wasn't a book on optics yet. I was quite surprised by that. There wasn't a focused set of knowledge that explains this concept, and how it works in great detail. So I decided, "You know what? Maybe I can be the one to do it?"
Len: And the book, I should say - has sold very well, which was interesting to see. And yeah, it's interesting - we'll talk about writing books and being a self-published author in the last part of the interview. But if there's something that you know, that no one's written about - go fill the void.
Chris: That's right.
Len: Go fill the void. You can do it. It'll take a while. To write a good book is a big commitment and a lot of hard work, and you'll want to bring other people in if they're willing to help you. But if there's something that you know about that no one's written about, I guarantee you there are people out there who want to read a book by you about that.
The natural thing we should talk about next, is - what are optics, and what's the history of the topic, and how did you specifically become interested in that?
Chris: Yeah. So, what are optics, I guess? When you hear the term, maybe you think of glasses or maybe a magnifying glass - something like that. And the programming discipline of optics, they make analogy to that. So lenses, which are one type of optic - they help you focus on a specific smaller piece of a larger object, like a magnifying glass, right? And so let's talk about what they actually can help you accomplish.
If I were to maybe use an analogy to something, I would start by talking about maybe Java setters and getters. Typically you'd have a getter and a setter for each property in a Java object - and that's really nice, it abstracts away the idea of dealing with maybe direct memory access. That's nice, because you don't need to really care about where in the Java class that property actually lives. And so optics follow along the same principle, and take you to a different conclusion. So optics, rather than being just individual functions existing in a class, they're actually a value.
You might have an optic like a lens, which is one particular type of optic - and that lens represents the reference to some smaller value inside some larger object, for instance, maybe a property of class or a record, and it knows how to get and set. But it's just a value. You can pass it around. You can give it to other functions. And that gives you some really interesting side effects.
Now that we can move this around and do whatever we want with it, we can actually use it to start abstracting over some other things.
Something that's really helpful here is that we can use this reference and build functions that operate on data, even though they don't know where it lives. They don't really care where it lives. And that lets us separate our concerns of what we want to do, from where we want to do it, or which data we want to perform it on. So if we follow that through on its logical conclusion, we start to realise, "Oh, we can abstract all sorts of different types of references too."
What other types of references are there? What other things can we think about? Well, rather than just selecting a single property, what if we were to select multiple properties across the object that all have the same type? Or maybe we select every element of an array at the same time, and then perform that operation over all of them? And the nice thing is that we can write our mutation or update function, and it doesn't need to know where in the object it is performing.
That means it's much more reusable. Because we can pass in a different reference each time, but reuse the function. Or we can change the function, but re-use the reference, right? And we're just not getting those things all convoluted with each other.
So then, where else can we take this idea? We've got this idea of abstracting over references. Well, there are all sorts of patterns we can actually bake into the reference itself, so that the behavior doesn't need to worry about it.
One probably relatable idea is, in C for instance, you might have a reference - in that case, a pointer - which might be null. Oh, uh-oh. If you try and like get or set a null pointer, right - you're going to have a bad time.
In optics, we can actually bake in this idea of like, "We can handle that null and there's different ways of doing it."
So we can maybe replace the value there with some default, or maybe we can say, "Well, if you're trying to run an update over something that's not there, we just won't do it at all. But we won't crash, so that's a benefit." You can then start to add these strategies, right?
You can even come up with any strategy you want. You can put filters into your getters. So that you can say, "Well, okay - I want to focus on this thing, but only if it has this property." And so when you start to build up this really cool and complex language of combinators, they get really quite powerful and they're quite terse - and they all just link together like Lego pieces, right?
One really interesting thing is that, the way optics are designed in Haskell, specifically - is that they're all interoperable with each other. They compose with each other, no matter which library they're from, so long as you build them correctly. So I can write a library and you can write a library, and they'll both click and work with each other. The ecosystem is quite open in that way, which is great.
You also mentioned the history and where they came from. The history of optics is quite interesting. They're actually not that old. They were invented around 2012, and they were designed out of frustration, where someone was trying to do games programming in Haskell, and they were hitting some performance problems.
Because in order to edit a property on a deeply nested object that they had in their game, well, they had to unpack this object all the way and find the property and edit it - and then repack this object back together. Because in Haskell, most of the data structures are immutable. You can't just edit something in place, right? This is just the way Haskell is.
But at the same time, they were getting frustrated and they thought, "Well, okay - can I make this more performant?" And they ended up designing lenses, just to help with this performance problem, and it ended up helping a lot - and modern lenses are actually still extremely performant.
But then it forked off into this really, really interesting study. This kind of, "Oh, this is fascinating. These things compose and you can abstract over them." And people took it from there.
Then it spiraled off into this whole other thing, where people got interested in the mathematics side of it and started writing papers, and finding analogies in category theory, and how it relates there.
And actually, so - people have been studying - some people studied its applications to databases. I think a paper on applying this to database views. And so it's been really interesting to see how the math community plays with it for a little bit, and they come up with some new ideas. And then the - more practical, I suppose, programmers - start to use these ideas that the researchers came up with, and then they develop some new things. And then the researchers take that. And it has this really cool back and forth feedback loop. And there are still new optics being discovered all the time.
So there was a whole new paper that discovered a whole new set of optics this year, that was released. So it's definitely not a dead discipline yet. There's a lot of learning going on and - it's really exciting to see where it's going to go.
Len: Thanks very much for sharing that. You're setting off a lot of ideas in my head when you're explaining that. But I think one of the most important takeaways is for people to understand - and you explain this very well at the beginning of your book, I think? Or maybe it's even in the book description? That although you chose Haskell as the language to use in the book, the concept of optics is not unique to Haskell.
Chris: Right. It's a math - at this point, it's even transcended programming into mathematics, and there's all sorts of applications for it. There are now optics implementations in Haskell, in Scala, in JavaScript. I think there's even one in Python. And they all have varying levels of effectiveness or brevity. But it's definitely a concept that's starting to take off. Because I think it's very elegant.
Len: Speaking of elegant, you've written an elegant book. So this might be a good opportunity to move onto the last part of the interview, where we talk about your practice as an author. I guess my first question would be - why did you decide to use Leanpub as the platform to write and publish the book?
Chris: Sure. In short, I would say I probably used Leanpub, because Sandy used Leanpub. Which is great, some word of mouth stuff there. And he had really good things to say about it. I did actually end up using it in a slightly different way. I think Sandy ended up building his own workflow to publish the book through Leanpub.
But I was really interested in the Markdown sort of workflow. For those listeners who don't know, you can really quite easily hook up your GitHub account and set up a repo there. And so I would just write in Markdown, that's what I'm used to as a programmer. I open up Vim, and I just crunch away on Markdown. And you can make commits and push them up, and then Leanpub can just build the book from there.
The idea that I could write in this very simple format that I understand, I can have all of my code there - I'm not trying to write code in a Word document or something silly like that. And that it can build for PDF and EPUB and all of these different things - because I know Sandy had a little bit of trouble getting - he had to write his own tooling to get these sorts of mobile books and those sorts of things, right? So the fact that I could do it without any work from myself, was very appealing.
Len: And you didn't publish it in-progress, is that correct? You just published it all at once with a big launch?
Chris: Yeah. That's in part correct, actually. I started off with a Patreon campaign. I had a Patreon page and, that was actually, I would say, a key part of my publishing experience. Because what it allowed me to do was, I could get people on board early, who were invested enough in the book to pay a monthly fee in order to access the previews as I'm working on, right? The chapters as they come out. So I knew that they were invested in the idea.
I could validate that people were interested in the book, and I had that audience to offer feedback. How is this going? Is this sensible? Does the structure make sense? And they were invested, right? I wasn't talking to a wall, they had already invested some money in this. And then over time, that developed and developed - and I kept it on Patreon until the book was actually finished. And then I was able to easily move it into Leanpub. I was very thankful for the simplicity of Leanpub's coupon system actually.
So I was able to move it over to Leanpub, and I said, "Okay, well anyone who supported me on Patreon gets a free copy of the book they've already paid for through Patreon." And so I just gave them all a Leanpub coupon for it. And then I didn't have to keep sending out the books on Patreon, I could cap that off and say, "Okay, everything's on Leanpub now, and all the future purchases go through there."
Len: I really love that story. Partly because it sort of maps on to a bit of the origin story of Leanpub itself, where my colleague Peter wrote a book - he published it on a service that didn't technically have like an in-progress thing, but you could update your PDF easily, basically.
And so he published it when it was unfinished, and then he gave people a little password, "Rumpelstiltskin", so that they could get onto like - I think it was, I'm probably getting it wrong, but like some message board somewhere. And so what happened was, he was doing, in a way, a similar thing - giving people who'd paid already for the book, access to a special place where they could get updates. And he actually got a lot of - what he started getting was feedback from people, like, "Why don't you write about this?" Or, "There's a typo there," and stuff like that. Did you get feedback from people while you were writing, from your Patreon supporters?
Chris: Absolutely, yeah. I got a lot of typos and that sort of thing. I actually put a link to a Google form in the very front of my book, so that I wasn't getting emails and DMs all over the place, right? I centralized it, and actually put it in a spreadsheet, so I could very quickly - I had fields for, "Oh, which page was the typo on?" And it made it much, much faster to fix up.
But as far as more constructive feedback, I did actually need to go out and pester a few people. Luckily I had one person who was very amenable and open to that, and they were very interested in the subject matter - so I latched onto them from that point on, and just kept sending them every new chapter and said, "What do you think of this, and how's that going?" So that was very helpful.
Len: That's really fantastic.
We leave this part of the interview for the end, for people who are interested in learning the nuts and bolts and people's experience of publishing, but - so you set up a Twitter account) for the book.
Chris: I did, yeah.
Len: And have you been getting people on there?
Chris: I've gotten a few. I made the Twitter account for the book. I wasn't exactly sure what its purpose was going to be, at the beginning. But I figure, more press is good press, right? So I made that. Even if it just means that people will see every tweet I tweet twice, then I guess maybe that might get it in the front of their mind a little bit more. So I did make the Twitter account for the book.
I would probably do it again. Whether it was super effective, I'm not really sure. I have much more followers on my main account, so I still end up tweeting pretty much everything about the book on my main account. But it was an interesting experiment, and I wouldn't say it hurt anything, that's for sure.
Len: The last question I always like to ask on the podcast, is - if you could ask us to build one feature for you or fix one problem for you on Leanpub, what would you ask us to do for you?
Chris: Ooh, good question. For myself, I think I would be really interested in - this is a textbook. I've gotten a lot of requests since I put this out actually for a physical copy. A lot of people really enjoy having the physical textbook on their desk in front of them and flipping through it. It's got some nice cover art, and that way they can lean it up against the computer while they're working on it, right?
And so I really, really appreciated the export to a print-ready PDF feature that Leanpub has. So even though Leanpub won't print it for me, they made it extremely easy to send it to a PDF, and ship it off to a distributor.
So one thing I would really actually like is settings to export to different form factors. So far as I know, Leanpub currently only really supports the eight and a half by -? Is that actually correct, or do they have other -?
Len: Oh no, we have lots of different page sizes.
Chris: You have lots. Oh, okay.
Len: Yeah, yeah.
Chris: I need to do some digging in there. I think I got set in my ways. Well, that's great, okay - so you've already done the feature that I wanted, the ability to look at more form factors. I really appreciate that.
Len: Well, obviously we need to improve the visibility of that, yeah. We've built a feature over the years called a Print-Ready PDF, which lets people export a PDF, so that it can be uploaded to print-on-demand services, and things like that, so people can get print copies of their books.
And yeah, actually - one of the most important elements of it is giving people the - because the service that you're using - so you can only upload a certain set of page sizes, and they'll specify them for you. And so we try to provide those page sizes for people. It's a really important thing, so we do do our best - and if you ever, if you can't find it - please reach out to us. And if you can and the page size that you need isn't there, please reach out to us at hello@leanpub.com and we'll build you that.
Well, thank you very much, Chris, for taking the time out of a beautiful Saskatchewan summer evening, I imagine, to be on this podcast, and thanks for being a Leanpub author.
Chris: Thanks so much Len, I appreciate it. Have a great day.
Len: Thanks.
And as always, thanks to you for listening to this episode of the Frontmatter podcast. If you like what you heard, please rate and review it wherever you found it, and if you'd like to be a Leanpub author, please visit our website at leanpub.com.
