Changelog & Friends – Episode #80

Discovering discovery coding

with Jimmy Miller

All Episodes

Fire up a REPL, grab your favorite Stephen King novel, and hold on to the seat of your pants! Jimmy Miller returns to reveal why, at least for some of us, discovery coding is where it’s at.

Featuring

Sponsors

Temporal – Build invincible applications. Manage failures, network outages, flaky endpoints, long-running processes and more, ensuring your workflows never fail. Register for Replay in London, March 3-5 to break free from the status quo.

Augment Code – Developer AI that uses deep understanding of your large codebase and how you build software to deliver personalized code suggestions and insights. Augment provides relevant, contextualized code right in your IDE or Slack. It transforms scattered knowledge into code or answers, eliminating time spent searching docs or interrupting teammates.

Notion – Notion is a place where any team can write, plan, organize, and rediscover the joy of play. It’s a workspace designed not just for making progress, but getting inspired. Notion is for everyone — whether you’re a Fortune 500 company or freelance designer, starting a new startup or a student juggling classes and clubs.

Notes & Links

📝 Edit Notes

Chapters

1 00:00 Let's talk! 00:38
2 00:38 Sponsor: Temporal 02:03
3 02:41 ISPs & Friends 07:31
4 10:12 Jimmy is back! 03:29
5 13:41 Blinkist (not a sponsor) 02:41
6 16:22 Packaging matters 01:59
7 18:21 Jimmy's bangers 02:02
8 20:23 Discovery Coding 03:04
9 23:27 Sponsor: Augment Code 03:30
10 26:57 The four designs story 04:01
11 30:58 Pantsing 01:00
12 31:58 The rubber hits the road 03:04
13 35:02 Not much tooling 06:36
14 41:38 Stephen King's method 03:39
15 45:17 Applying King's method 00:50
16 46:07 Flow state debate 05:18
17 51:25 Discovery coding != flow 00:43
18 52:08 Discovery coding != bottom up 03:38
19 55:47 Sponsor: Notion 02:48
20 58:34 How to get started 08:02
21 1:06:37 Discovery code every time? 02:13
22 1:08:50 The 2-year debug story 02:30
23 1:11:20 The bad open source story 02:17
24 1:13:37 The group project plagiarism story 01:12
25 1:14:49 Restoring your session 04:17
26 1:19:06 Personal comments 04:23
27 1:23:29 Implementation details 08:20
28 1:31:49 Do you like this idea? 00:53
29 1:32:42 Comment pack rat 01:45
30 1:34:27 Commit message confessions 01:19
31 1:35:46 The Field Notes friend 00:34
32 1:36:20 Dog visitation 01:20
33 1:37:39 Beyond the blog post 03:48
34 1:41:28 Wheel reinvention 01:26
35 1:42:54 Back to personal notes 02:09
36 1:45:03 Does Evernote still exist? 01:00
37 1:46:03 Modern OCR tools 01:15
38 1:47:18 Discovery coding first steps 04:33
39 1:51:51 Bye, friends 00:49
40 1:52:40 Coming up next 01:15

Transcript

📝 Edit Transcript

Changelog

Play the audio to listen along while you enjoy the transcript. 🎧

So always convincing the customer support representative that you know probably more than they do about what we’re talking about is always an awkward thing… Because you don’t want to be a jerk about it, but it’s like, “No, I’ve already rebooted things. I’ve already done whatever’s on your checklist there, before you pass me on to the next person… Like, I’ve been there, done that, so please, let’s just dismiss with the pleasantries, and can you please upgrade me to somebody technical?”

[laughs] The number of times they’ve been like “Can you please restart your computer?” “Okay, I’ve restarted it.”

Yeah. You pause for half a beat…

Yeah, you just pretend you’re doing all of the things that they’re telling you to do, so that way you get through their checklist… And I totally get it, they’ve got to follow a procedure. But yeah, when you’ve done it like a few times, and you’re like… What I ended up doing for this dropping packets constantly is making a program that just ran, and like had a graph of the percent of packet drop I was having all the time…

There you go.

And once I could show them “Here’s a chart…”, that seemed to be convincing enough to send it to somebody else.

Right.

Thankfully, the Unifi gateway does that, the UDM Pro.

Oh, yeah?

It does versions of that for you.

No coding necessary.

Oh, nice.

Yeah. So like “Here you go. Here’s my dashboard to my enterprise-level home network.”

Yeah, this was sadly a – the way this apartment was set up, we didn’t even have a in unit router. It was all like at the the apartment level. So I had access to nothing, and that made it much trickier. Because like if things went down, you couldn’t just like unplug something either… It was just – I understand they wanted to be all fancy. It ended up being way worse having wired Ethernet throughout and all of that, with a centralized router set up. It was just likee, come on… They at least actually did it secure. I was surprised with that. It was network network-isolated properly. But…

My ISP is actually awesome… I’m out here in the sticks, and there’s only one company that would run fiber to where we are, and they were a small business provider… So it’s like residential fiber, but on a small business providers network. And so it’s kind of the best of both worlds, because it’s kind of retail pricing, so it’s all – it’s not like business pricing, which is always, I think, overly priced… But I’m one person away from like a highly technical person who remembers me, or has my case files available… And so I can just get past the first person whose job is just to answer the phone and basically route. The next person up is very good, and knows what’s going on, and has my history… And so it’s been pretty awesome.

The hard part with the residential and retail ISPs is like getting through the many layers of people they’re going to redirect you to before you actually are talking to somebody who can solve your problem, and knows how to. It’s nice to have a graph when you do find that person.

I think it’s pretty – it’s like basically a miracle that you have amazing internet in the sticks.

It is. And not a miracle as much as it is persistence of me demanding it…

For years.

It’s like the only time I’ve been political in my life. It took a couple of years, I think; maybe 19 months… Because I was actually promised by the person that sold me this land that Cox cable internet was run to the property. And I bought the property under that assumption. I did not do my due diligence… I did double-check. I told them to double-check to make sure it was true. And I thought that was due diligence. But apparently, they can just double down on the lie… So I bought it under that assumption, and built a house, three years later moved out here, and I’m like calling the Cox to set up our cable internet and they’re like “We don’t have service to your area.” Like, “Oh, you do. The person that sold me this land says you do.”

[laughs]

And they’re like “No. No, we do not.” And so I got a price on what it would cost to actually run Cox cable internet out to me, and it was like sixty five thousand dollars, or something like this.

Wow… Yeah.

So I tried to force them to pay that amount, the person that sold the land, and that didn’t really work… And so then I decided, “Well, I’m going to organize…” We have about 10 acreages in the area, all on like three circles, and I found this Great Plains - shout-out to Great Plains in Nebraska - a great ISP… And they’re like “Yeah, it makes sense for us to run fiber. We had fiber around you, but not directly where you are. If we can get 10 households to sign a contract that they will buy it for four years or something, we’ll go ahead and trench out to you guys.”

And so I went around to my neighbors and got people to sign papers… And everyone was very happy, because all we had was DSL that was oversubscribed. And they wouldn’t even let me on it, that’s how oversubscribed it was. So I was using - no, not Starlink. Starlink didn’t exist. This is from 2016, 2017. I was using a Verizon wireless hotspot, 5G… And I would tether to that, even to record the Changelog. And it was dicey, wasn’t it, Adam? I mean, there was times where it was so bad.

We could have never done this video-first then. Never.

No. Never.

No. That would have been that – that is one of the big things that is awful, is trying to do video on bad connections.

So I went knocking on doors and I’m like “Please vote yes on this initiative.” And they’re all like “Of course. Who doesn’t want fiber to their house?” They’re like “Of course.” It was the easiest sell of all time. And so that’s how it happened.

[00:08:10.24] So 10 houses for your contract.

Yup. I only got one no out of all the houses that I went to.

“We don’t use the internet around here…”

They were – they’re kind of isolationists. They’re just like “Leave us alone. We don’t want to talk to anybody, about anything.” I’m like “This is just fast internet.” They’re like “No, we’re good.” “Okay… Sorry for asking.”

Send them a letter.

My wife’s grandma lives out in the middle of nowhere, and got a smartphone for the first time just a few years ago. And she was like – she was telling Janice, my wife, “I’ve found this thing on my phone and I don’t know what it is, but it starts with the W… And everything on there – just like, anything I look up, it just tells me everything about it.” And Janice is like “Do you mean Wikipedia?”

I was gonna say, Wikipedia, my guess…

Yeah, yeah, yeah. Wikipedia.

[laughs]

The original ChatGPT.

Yes, exactly.

Gan-Gan is what she goes by. She’s like “Gan-Gan, do you know what Wikipedia is?” “No.” “It’s the internet.” And she was like blown away that she had used the internet.

That’s awesome.

This was the first time in her life that she knew she had used the Internet on her own, and like discovered it… Which I just thought was – it’s really funny now, because she she always got mad at people fact-checking her, but now she fact-checks everybody on Wikipedia.

There you go.

Remember that website “Let me google that for you”? Did you guys ever use that one?

Oh, yeah…

…very snarky with people, because they’d ask you a question that was just easily googleable… I feel like that’s what the current crop of LLMs are. They’re like “Let me wikipedia that for you.” Like, instead of going to Wikipedia, you just ask them, and they’re basically just reading it to you, aren’t they? They’re like “Here’s what Wikipedia says. I’ve consumed it, and I will now act like it’s my information.”

Yeah, I absolutely hate the search feature in ChatGPT. I have to constantly ask it “Please stop searching. I don’t care what you’re searching. I just want what’s in the memory here, because it’s going to be higher quality than what you’re searching.” But yeah.

Yeah. It’s too slow, too. Like, I can search the web faster than you can search the web.

Yeah, exactly.

Fun times. Fun times in the internet lands, you know…?

Well, we brought you back, Jimmy. We had so much fun talking to you last time, hearing your stories of Secret Service folk knocking your door down…

Yeah, it was really great. I’m glad that I got to come back on Friends. I will say, Friends are definitely my favorite episodes. I like the kind of free form content of Friends.

We appreciate that.

Yeah, super-excited to be back.

It took us a long time to do Friends, because we didn’t think anybody wanted to hear just us chitchatting with people as much as they wanted to hear the classic Changelog interview, you know? But apparently… What do we know…? [laughter]

I think interviews, they can be really good. Like, there are great interviews. I’ve listened to a lot of them on here that are great. But I don’t know, after you hear enough interviews, sometimes it just does kind of get a little formulaic. I’m one of those people who just listens to a ton of different podcasts, but I’m also not like a completionist about them. I don’t listen to every single episode of every podcast that I listen to. And so I don’t know, it can break up that monotony; if you have a bunch of different interviews, and then you just get some like people hanging out, chatting… It’s just kind of nice, especially in like the background.

Totally.

Because people are hanging out, chatting, and you’re just kind of listening in the background; if you miss something, it doesn’t really matter.

Yeah, it’s lower stakes. That’s why I call it like a weekend talk show, because it’s like, listen on the weekend. If you miss a part, no big deal. It’s just another one of our stories that don’t matter so much.

I disagree.

But I’m happy to hear that you like that. Do you now actually listen to podcasts while working or while coding? Because I can’t do that. But a lot of people do.

[00:11:47.16] It depends. If it’s actually something where I have to focus, no. If it’s like I’m having at work to do some really tedious, boring, repetitive tasks that I don’t want to do, and I’m fine with getting distracted and it taking 12 times longer, then absolutely. But yeah, if I’m trying to like really code, I cannot – I’ve found myself like accidentally listening to a podcast and coding… I was just doing something else, and then I’d start coding something… And I’m like “Why am I so frustrated right now?” And it’s because those two parts of my brain – the linguistic part of my brain is like overloaded right now, it feels like. And so I have to have to turn off the podcast.

It’s kind of like when you’re reading a book and then you realize you haven’t been paying attention for the last five minutes… Like, you’re still reading it, but you haven’t been actually with it… That’s how I get when I’m trying to code and I’m listening to a podcast. I’m only going to be doing one of the two. I’m not going to be doing both of them.

Exactly.

I can multitask as long as one thing is like physical and the other one’s mental. But two mental things… Come on now.

Yeah. One of my favorite things is to drive and listen to a book. Like a long drive. Not like a short drive. An hour-ish, you know… And then if you don’t drive again for a while, you’re like “Man, that book is just sort of still sitting there, waiting for me to take another long drive.”

You don’t finish it.

I’ve tried to do audio books, and I’ve found I can do nonfiction, because I’m fine with missing moments… But I do the zone out thing whenever I have – if something gets my attention and if it’s fiction, then I’m like “Wait, what just happened in this story? What is going on?” Or the only other time I do audiobooks is if like I’m at a company and some big wig is like “You have to read this book. It’s so important”, and I really don’t want to read the book, I’ll just get it on audiobook and put it at like two and a half X speed…

Blinkist, man. Have you heard of Blinkist? I’m not a sponsor, but I was a big Blinkist fan back in the day. This is basically cliffnotes for business books.

Oh, okay.

So they distill down every business book, and self-help, and like nonfictional things… To 12 to 15 minutes of just the high points. Because that’s pretty much how much information is in a two-hour listen.

Yes, no question.

And so it’s really good. And then of course, you can deep-dive if you want to. But I actually was a subscriber of Blinkist… It’s like a 15 bucks a month kind of a thing; like an Audible replacement. And they do a really good job with it. I appreciate their product. But I kind of got to the end of Blinkist as a subscriber, and I was like “Let’s do all the top 50 business books that everybody says I should read.” Atomic Habits, “How to win friends and influence people”, and just all that stuff. And I got to the end and I was like “Oh, I ran out of Blinkist”, so I just canceled the subscription. I’m sure there’s more things now, as people continue to write, but… That’s a pretty cool service, really.

That’s a fascinating idea. It’s almost dystopian, in a lot of ways…

It is. Yup.

Like “Here’s all these things you have to do for something, and you really don’t want to do them, so you’re going to pay money monthly to get the distilled versions.”

Yes. Yeah, man.

And I’m on the record saying most business books aren’t worth the read, even when somebody tells you that they are… There are things in there that are worth it, but most of the time – like, Adam loves these kind of books, and he will tell me… Like Essentialism, for instance. And he’ll tell me like the most important ideas in essentialism… I feel no need to go read that book at this point. And Blinkist kind of does that if you don’t have friends. I’ve got Adam… You’ve got big wigs telling you to read stuff, but…

[laughs] It sounds like you need to do the commercial. “Blinkist. Book recommendations if you don’t have friends.”

Yeah, that is a good one, you know?

But now you’ve given the hack to how to get to the end of Blinkist and cancel.

Right.

Ah, Blinkist…

I mean, isn’t that kind of the problem? Like, that’s why these business books are so padded out, because they have to make the value worth it…

Right. Like, you can’t sell a blog post.

Yeah, exactly.

Like, I have a blog post worth of ideas, but I have to turn it into a book length.

[00:15:54.29] I have bought some very awkward – like, I didn’t realize it, because I didn’t look at the page count… I bought some “philosophy books” that were actually just papers, but they took it and put really big font size, and shoved it into a very small book… So like if you look at the paper, it’s like a 25-page paper, and then it’s like a hundred-page, but tiny book.

Yeah. Double space…

And it’s like “Why? Why is this what I just bought? I did not realize I was buying this. This is awful.”

You know, it’s funny, though. I think it’s packaging that matters, though. I think it may not get past you, but there’s some people like “I got the book of these several manuscripts” that was like a one-page read, basically, and they’re like “I got the book.” Aand it might motivate them to pick it up, potentially. Or it’s like a coffee table thing, or whatever.

That’s true.

The packaging, I think, does kind of matter… Because I think – here’s an example, potentially, of packaging… It’s like, we’ve had this podcast for many years, and people listen to this show… And we have people that hang out in Zulip that say “Hey, I don’t really care that you have a YouTube channel, or that you’re going to turn this into a video-first podcast. I don’t see the benefit of it. How’s that help me?” And to it we say - to use Gilfoyle’s way of speaking; yes, Silicon Valley - to it we would say “Well, there’s other people out there that like video length or full length video podcasts. And so it may not be specifically for you, but it’s packaged differently for somebody else.” So we’ve now taken the same audio podcast somebody may not pay attention to because it’s just audio, we’ve taken the same product, repackaged it as a video podcast, a vlog, maybe, I don’t know… A [unintelligible 00:17:30.14]

We need to repackage it as a book. Didn’t Tim Ferriss do that? He took all of his interviews…

Of course, he’s a genius of packaging, isn’t he?

Yeah, I think he is.

And he took all of his interviews off the Tim Ferriss Show and turned them into a book called I think Tools for Titans, or something like this. Because these are long form interviews. And he pulled out all the tools they referenced, and what they use, and then turned it into a book and repackaged it. And I’m sure he sold thousands, if not hundreds of thousands, if not millions of copies of that… So packaging is important. I do think that’s why a lot of people turn things into books, because a) now I’m an author; now I’m a published author, whether it’s self-published or not. For some reason, it’s still cooler to be non self-published, even though it sounds like mostly downsides besides the clout… And “I’m an author. I wrote a book.” That matters. That’s clout. And that’s just packaging. Jimmy, take your blog posts, because you’ve written some bangers now, man… You’ve been writing some bangers…

[laughs] Thanks.

Repackage those suckers. “The future of coding”, the book.

Yeah, I have thought about “Does this make sense as a blog post? Does it make sense as a podcast? Do I want to do a solo podcast?” Things like that. And the thing that I don’t like about the repackaging… I think it can work, and I think the video to audio to video, I think that’s an easy one. But podcast to book… I think the translation often is real awkward. Like, you actually really have to do the work, because they’re just different mediums.

I find the same thing is true – if you compare like a well-produced solo YouTube video, versus a talk that someone gave remotely. A talk that someone gave remotely – both cases, they’re just sitting in front of their computer, talking to the camera. But, you know, one’s more awkward than the other. [laughter]

But yeah, no, I’m excited about this blog post. I’ve had some good luck with people liking my blog posts lately. I spent a few years trying to write blog posts, and just like have no clue how to write at all, and like what my voice was, or any of that… And then just recently, each blog post I’ve written since the one you all invited me on, I’ve kind of felt it better. I’m finally starting to get there.

[00:19:51.12] You’re getting your voice and you’re getting your groove.

Yeah, which was nice.

And we certainly enjoyed this one. Of course, the last one was “The best/worst codebase.” Was that the name of it?

Yes. Yeah.

Okay. For some reason – I knew it was “best/worst”, but I [unintelligible 00:20:03.00] “Was it codebase?” It was a big hit, and we had a podcast that we either named the same, or similar, talking to you about it, which was awesome… And now Discovery Coding… Of course, you also had [unintelligible 00:20:13.18] which I think we kind of actually touched on in our last conversation… Or maybe that was post show. And we didn’t talk about it too much. But Discovery Coding now, this most recent post of yours, is the one that we’re all referencing and would like to talk about and unpack some… Because on this particular one, I felt represented, all of a sudden, because –

Okay, good.

This is like one of those things when you don’t realize you are something until someone tells you. I’m a discovery programmer. Like, this is what I’ve found out. I didn’t know there was a name for it. Of course, there wasn’t, I guess. You’re kind of – you’re naming us, and not shaming us.

Yeah, absolutely.

Which was kind of the point of the post. Name us, but don’t shame us. You know, we’re not all as organized and outliny, and think ahead. And as I was reading it - we’ll talk about the details, of course, and have you summarize as well… But as I was reading it, I was thinking about Leslie Lamport. Now, there was an interview that you may or may not have heard, that I did with a guy who would absolutely despise what you’re writing here, because he thinks that you should absolutely think ahead, write everything down, do all the math, think outside of the code… And that’s his soapbox. So I was thinking, “Oh, Leslie would hate this.” But I’m kind of loving it, because I was kind of not jiving with what Leslie’s preaching, even though he’s way smarter than me… But discovery coding - what is it? How do you realize you do it, and why should we not shame people for being like us?

Yeah. So I was actually listening Brandon Sanderson - well-known sci-fi fantasy author; he’s got a lecture series that he’s put out for a number of years… But he’s got the most recent one on like how to write sci-fi fantasy novels. And I will probably never, ever write any sci-fi fantasy novels, but they’re fun to listen to. They’re really interesting to just kind of hear behind the scenes how he thinks about them. And that’s where he talked about this discovery writer, versus an outline writer.

Stephen King is really well known for hating outlines. He thinks as soon as you’ve written an outline, you’ve ruined the story, because that is the story now. And the story is supposed to come out as you’re writing. And so he never writes outlines. He just sits down and writes. And Brandon Sanderson is very much like the opposite bent. He outlines all his books forever… And so I was just thinking about – you know, listening to this lecture and thinking about how much this idea of discovery writing fits with how I code.

And this is one of the things I often find, is – I don’t know, as much as we love to talk about programming, we don’t like to reflect on our actual practice much. And I was trying to think, “Is there anything that corresponds to this? Have I read this anywhere?” And I tried to find something. I was like “Surely somebody has written about it.” And I’m sure they have. But trying to find it was really – I couldn’t find anything quite like it. So I just thought “You know what, I need to write this down.” And it was all done in one sitting, after listening to that lecture. It took me an hour or something to just write it down and put it out there… And so it was great to hear that people – so the basics of it are really pretty simple. When you go to write code, you don’t know what you’re going to write yet. You discover what you’re going to write in the process of coding.

Break: [00:23:28.00]

You discover what you’re going to write in the process of coding.

Does that – like, to me that’s just how it works… But to an outliner that sounds foolish, right?

Or not true. Those people are like “No, you don’t.” Okay, maybe in the small, but not in the large. You start to attack it from different angles, right?

Yeah, I think this is one of the things that’s always been a tension with me. I’ve worked at a lot of different companies that have had different kind of cultures around formality, and a few companies I’ve worked at and the company I’m at currently has been very big on write-ups. You need to have a design document before you go implement something.

And what I recently did is – you know, we don’t need to go into details of what it was, but it’s a hairy problem that we’re dealing with, and I was told to go write a design document of how we could deal with this… And I came up with four ideas. And I wrote about each of those ideas, and we had a big discussion about it, we had meetings about it, and we picked one of them. We all agreed, “Number three is the best option. Let’s go with number three.” So Jimmy, go sit down, go start writing a prototype of number three.

I got not even an hour into writing the prototype of option three before I realized the whole idea was completely wrong. As I started writing the code, I was like “Okay, well, I would need to do – wait… No, that doesn’t make sense. Hold on, I need to do – that doesn’t make sense.” And I realized that the way we can solve this problem was so much simpler, so much more elegant, and it was one of the options I had never even considered, and would have never considered if I didn’t sit down to write the code.

And so I think that people who don’t discovery-code would probably say that – I think the problem that they have, and I’ve seen it… We can talk about the problem with discovery-coding; there’s lots of problems with it. But the problem that outliners often have is that they’re unwilling to do that last step. They’ve come up with a solution, it’s actually a bad solution, but since they have the outline for it, they’re just going to finish it. And maybe even they’re going to ship it. And then it runs into problems, and they’re just going to keep going and trying to fix it, and fix it, and incrementally change it, and fix it… And what I’ve found is if you like kind of relinquish control a little bit, you let the code tell you where it wants to go, you’re paying attention to the code itself, especially in big, complicated legacy systems, like we talked about last time, you’ll discover solutions you just would have never thought. So yeah, I really recommend the practice because of that.

One thing it seems though just looking from the outside or hearing the story is that it seems like the practice of the basic outline, which was the four different options that you could then explore led you to discover it was wrong. So technically, you outlined first, to then code to discover the wrong problem.

Yes. So –

Right? Am I wrong?

No, you’re not wrong. I will say, it took me a very long time to write those outlines, to come up with the ideas etc. And I do believe, and I have done it before, where I didn’t do that, and I just started coding and I discovered it much faster.

You know the problem and solution better than we do. Let’s say for some reason you could have skipped the four outlines, and you just went to coding, and started thinking about the problem. Could you have gotten to the solution you got to faster than the four outlines?

Absolutely. Yeah, the solution I got to was like totally out of left field. Like, it was not related at all to any of the solutions I had listed, and it was only out of once I started being concrete. I think this is the key that I think maybe is lost – when people hear discovery-coding, they think you want to fly by the seat of your pants. In fact, in writing people who don’t like this call it pantsing, because you’re flying by the seat of your pants. So they call discovery-writing pantsing. And I thought of doing pantsing coding or something, or pantsing programming, probably from the –

Where I come from pantsing also is the same thing as depantsing, and it means you pull someone’s pants down.

Exactly.

Oh, my gosh.

I was like, “But that’s all I think of when I hear that…” [laughter]

Like, “Oh, you pantsed him.” I don’t want to associate with that. I like discovery a lot better.

Yeah… I was like, “That sounds a little pejorative… So let me stay away from that one.” But the thing is, when you’re staying in this kind of high level outlining, you’re not confronting the concrete problems that are in existing codebases. So I think this is really useful when like there’s already existing stuff, and there’s already existing problems… And maybe it’s less useful when you’re starting from scratch.

I think that’s the key insight, is that the rubber hits the road faster.

Yeah, exactly.

[00:32:02.27] That’s really the key. You have to leave the hypothetical area/space and get into the real world as close - as we get digitally - to really know whether or not solution A, B, C or D is even viable. And you won’t know that about any of those four until you’ve actually let the rubber hit the road and realize “Ah, you know what? I’m banging up against this. I didn’t think I was going to be, but now I am.” And the faster you can bang up against it, then you start searching for other things.

Exactly. So it might seem like you’re trying to skirt process… You’re just being lazy. That’d be the accusation. Like, come on… Leslie Lamport, or Dykstra, these very rigorous “We’ve got to have formal methods, we’ve got to really think about this. We’ve got to prove things…” You know, I get that. I have that bent. I’ve played with making some alloy models, which is like TLA+ with a competitor, or whatever… I’ve liked some of this formalism –

That’s Leslie Lamport’s stuff, the TLA stuff.

Yeah. Yeah. Yeah. I like some of that stuff… But I think often when we – we can replace process with actually doing with actually doing work. And sometimes what you have to do to get something done is just start to doing it, and let the system itself tell you the constraints that you really have. And then, afterwards you can go write that document. You can go make that proof. You can go do all your formal methods. You can impose your big type hierarchy so that you guarantee that illegal states are unrepresentable. You can do all of the things, but you’ve got to start with something concrete, or else all of this is just theoretical and not practical.

It’s kind of the opposite of flying by the seat of your pants, isn’t it? Because you’re actually being more realistic, sooner. I feel like that’s just playing fast and loose, and that’s more the world of the hypothetical. I think somebody made up the statement architecture astronauts. I think I first read it in DHH’s writing, but I’m not sure if he coined it… Which really spoke to me, because it’s very easy in the world of architecture to just talk about and think about and maybe even try to formally prove a thing. And in the real world, that thing is unviable. Like, it just happens.

And getting to that dirt as fast as you can and start digging to me always made the most sense, because when I tried to do it the other way around, I would waste a whole bunch of time thinking that I had a solution, and then I’d go and try to apply that solution and I’d be like “This doesn’t actually work. This is not going to work, and now I’ve gotta start figuring some of this out.”

So I guess to me it doesn’t seem like flying by the seat of your pants describes it, but I understand why somebody might think that, because you’re not quote-unquote thinking up front. You’re just like coding right away. Cowboy-coding, as they call it.

Yeah. I think the other thing that maybe is hard about this, that I kind of have like some brief asides in, is like our tools don’t really support this style of doing things. Part of the reason why people would rather write a design document than go into the codebase and try to get some solution together… It’s like, it can be really annoying to make changes in codebases. It can take a really long time to find the right place to put something, and then you try to put something and you have this compile cycle.

I didn’t even touch on it in the blog post, because it kind of just like went behind my head… But if you wanted to do a clean build on that legacy system - when I first joined it was like 10 minutes; I think it got down to like seven minutes, or something… And trying to do – even though that’s not like the 24 hours I’ve heard some horror stories of… You know, having 10 minutes every time you want to make a change to like go explore something is incredibly slow. And so what you end up having to do is try to plan all of this out ahead of time.

[00:36:05.28] And one of the things I’ve found just to be – if you’re going to try to do discovery coding, you have to spend that time upfront, making tooling so that you can get a fast feedback cycle, and you can start discovering. And that just takes a lot of work to get to that point, especially if no one’s focused on it.

So I do most of my discovery coding at a REPL, or try to. What would that look like, if it’s not like an environment-ready loop that you can just program against?

Yeah. I mean, I definitely have a bias here, because I programmed in Clojure professionally for like five to six years.

And Clojure has – if you’ve never seen a Clojure programmer with a proper setup do their coding, it’s definitely like the best out there in my opinion and live feedback. So they talk about working at the REPL, but what they don’t mean is like a shell with a prompt. They just have their editor, usually Emacs, and you can evaluate any sub expression of any bit of code, and it just kind of live evaluates right there in your editor. And you can just start running… Like, I would have a REPL, quote-unquote, open for a month, that was the state of the whole system. Like, it was the running system that I’m modifying on the fly. So you’re just like reevaluating functions, redefining things… So I will say – I now have a lot of things where I work on like big Java apps, and I’ll just hack in a Clojure REPL in the middle of them, so that I can just like “Alright, I now have this nice little evaluation.”

How do you do that? How do you get a Clojure REPL into a Java app like that?

So Clojure is on the JVM, so it’s actually pretty darn simple to have – it’s like four or five lines of Java to just kind of… You get the jar, you shove it in, you put in a few little things, and it opens up a socket and then you just connect to it. And now you have like – that whole JVM application, you have all of the classes that are loaded into the runtime. You have everything that you can just start messing with.

And you mess with it in Clojure, or you mess with it in Java?

You mess with it in Clojure, but you can do all the Java interop. If you don’t have this, I know I have a friend, Brandon Bloom - he did Clojure for awhile and then he was doing Go. And he said his replacement for like the Clojure REPL was making little tiny shell apps in Go. So every single one of his functions he would like turn into a way he could just evoke it from shell, and then pipe things. And so he would try to take the system and break it up into little bits that you could kind of like isolate and call, and then combine those together to make little interactive environments. I’ve hacked in my own fake little programming language for a second into an –

For a second…

…application. Yeah… Especially now, with LLMs and stuff, you can –

Just while the boss isn’t looking, you know?

Yeah. I don’t like ship it, just to be clear. Like, it’s for me. It’s for me.

It can be really useful in production though, Jimmy. You know, that little back door just sitting there… [laughter]

You can find – I think for most systems you can find some little dynamic part of it.. You can find something where you can start messing with things. Even if it’s just like you add a bunch of flags. Like, I remember in an early job there was this – we went back and forth over and over again on this one form. It had like 70 different states, error states it could possibly be in based on like different combinations of stuff… And we kept having stories on like “Well, if it’s this combination, the error message should be that. And if it’s this combination, then the error message should be this.” And over and over again.

[00:40:01.00] So I just took that thing and configured it so you could like click on and off every single possible state, and see the error message right away, like a little dev UI for it… And just brought the person in office. – so I just brought them over to my desk and was like “What do you want the error message to be right here?” And then clicked on the Next button. What about now? And just like walked through all of it.

And what we discovered is actually there’s four classes of errors. And we would have never discovered that had I not taken the time to make the system respond that way.

It’s kind of like one part instinct, in a way; you’ve got to feel how things work. It’s like a race car driver even; these instincts that happen at millisecond speeds, that only a superhuman can do when you drive formula cars kind of thing. Not an exact one-to-one, but it’s a version of that, where you’ve got to sort of feel how the system works, and you’ve got to feel this response, this push and pull, back and forth, versus this outline. I’ve got everything in control, and I’ve plotted it out, and boom, it’s done. It’s just more organic, it seems.

Yeah. And I think –

Organic coding. Boom, there you go.

He already named it, dude. You don’t have to rename it.

No, I know he did. I’m just saying, organic is kind of catchy.

If I want to become a consultant and sell it, the next Agile, organic would be a good –

That’s right.

No, Jimmy Miller’s pantsing course. [laughter]

I almost spilled my coffee. So close.

Become a pro pantser, something like that.

I want to draw a couple of corollaries here, because at the opening of your post - now we’re in the meat of this…

We are.

…we’re in, I would say, the practical matters of this… But I want to zoom out a little bit on a couple other things, which is Stephen King. You’ve drawn this corollary to him and his style of writing - is everyone here familiar with Stephen King? I assume you are, Jimmy, because you wrote the quote there for him. Jerod, do you know who Stephen King is?

I haven’t actually read Stephen King, but I do know who he is.

I will tell you that I read Stephen King’s It as a 9 or 10-year-old, and it forever changed me as a human. I don’t know if it was for a good way or a bad way, but it definitely changed me. So yes, I know Stephen King.

Okay. Are you familiar with his writing style, aside from –

I read the quote from Jimmy’s, but no, I’m not a Stephen King stylist, a studier.

I’ve only loosely investigated this, and it’s funny that you put this in there, Jimmy, because I have a desire to be an author one day. And I, as of this morning, actually, as of yesterday, I have two book ideas that I may eventually do. Prior to yesterday, I only had one. And now I have a brand new idea. And I’m thinking about using the Stephen King method of writing books to get there. And the corollary really is this idea that he’s got two different style of people that he says writes. And you’ve got the plotters, which is like the outliners… And it’s funny you call the pantsers, that you’ve got this terminology, because the other writer style he has that’s called the pansters. I don’t know why, I don’t know the theory behind the name… Pansters. And they write on instinct. They go where the writing takes them, kind of thing.

And I’m really curious to go down this path, because he’s got this plan… I’m also a discovery coder. Having a plan is kind of cool. I have an idea and a vision maybe, but in the tactile, I’m going to just like hit the ground, see what works, and push back against the system, and see what I like and don’t like.

You’ve got a concept of a plan.

Yeah. You know, this Jerod, I’m telling you ideas all the time. I’m like “Dude, I’ve got an idea. Okay, it’s not fully formed… Just work with me here.”

Yeah. And I bring that rubber to the road right away. “Here’s everywhere that’s going to fail.” [laughter]

Sometimes it’s like “You know what? Actually… Well, actually…” I’m just kidding.

Yeah. Sometimes I think it’s a good idea, but a lot of times I’m like “Here’s why that’s not good.”

Discovery.

But he’s got a method, and I can paraphrase some of it, but it’s really short. He’s got three steps.

Write every day, murder your darlings…

Oh, yes.

Productive writing environments. No internet, no phone, no TV; just a laptop, water, tea, hydration and music. And he likes metal. So Stephen King writes to metal.

Really?

Yeah. Those are his three steps to getting into a mode to write, is this habit of write every day; this habit of when you go to write, it’s in an environment that’s suitable for writing. And like I said, no internet, no TV… Music is all you can have there. And what I’ve discovered is he gets into flow state quickly.

So I kind of wanted to bring up those steps and talk to you about that, and I suppose I’d imagine flow state. Because you’re kind of feeling it, and you can’t get into that deep immersed feeling of what it is until you kind of get to this place where you can sort of be in a trance, let’s just say.

Transcendental coding. What do you think, Jimmy? Do you follow those three steps to success?

I definitely don’t follow those three steps, in the sense of I don’t – maybe I do code every day. Not as a particular habit. It probably does just happen most times by happenstance… I do really like programming. I do often do it for fun, in my spare time… But I definitely have internet when I code. [laughs] I go to coffee shops most of my coding. So like the opposite of like – a very distracting environment.

Right. So you’re lucky then you can even get it done.

I enjoy – I find I’m much less distracted by having that constant background stuff going on than I am often focused in… I’ve always been of two minds about flow state. When I was younger, I definitely think I had flow state type stuff quite a bit, where I would stay up till like 4am coding, and like not realize the time. And I still do have moments of that. But I think most of my coding doesn’t happen in a flow state. I don’t know that I can achieve a flow state very well. I get very distracted very easily, and jump back and forth between things.

But I do think that there’s a lot that’s good about that general advice. Like, one of the things I’ve found that I’ve been really struggling with over time is to stop starting and start finishing. To like actually push through on a project. And one of the things that has been really helpful for that is being willing to make tiny incremental changes, even if I’m not feeling it. And I think that’s part of this, writing every day. Some days you’re going to write like a ton. Some days you’re not going to feel it at all, and you’re only going to write a little bit. And I have found that to be super-useful. Sometimes I’ll not be feeling coding at all, but I really want to make sure I actually get – I’m building a programming language right now, and I really want to actually get it so it’s good. And so I’ll just spend like 30 minutes fixing one small little bug, or cleaning up a comment, or whatever. And then I find myself like three hours later still working on stuff.

Time flies, right?

Yeah, yeah.

I mean, hours will go by if you’re in that kind of – hey Jimmy, that’s called a flow state.

Okay. Maybe. Maybe it’s a flow state.

It may be your version of a flow state.

It’s not the 4am coding flow state of his youth…

[00:47:49.17] I guess one of the things I always think about with flow state is like – the things people always compare it to, and maybe I’m just misunderstanding it, is like when you’re kind of grooving with music. I don’t know if either of you play any instruments… But I play bass, and – I haven’t really played it in a while, but I play bass guitar and I played standup bass as well in orchestra… And in that, you’re kind of captivated by the music. You’re really not thinking about where you are, what you’re doing, you’re just kind of playing. And that is not a feeling I get much with coding.

Would you describe your feeling as effortless momentum?

No, it’s always very effortful. Very, very effortful.

He’s working hard over there.

Gosh, Jimmy. Okay, maybe your flow state is different than other people’s flow states.

Yeah, I mean, usually when I’m doing this stuff, I guess in my spare time especially, it’s stuff that’s like way beyond – I’m trying to find things that are beyond my current ability. So I’m often confused, and finding it hard. The language I’m writing is compiled straight to machine code. So I had to go – I wrote my own compiling to machine code, and then I’m learning all of the intricate bits and parts, and it never goes smooth.

Let me rephrase it then. Is it seemingly effortless on the task, to stay on the task?

Ah, gotcha. Okay, okay.

Because you’re trying to solve the problem… And I think that’s what momentum is is suggesting there, is that you’re effortlessly on the task of the problem you’re trying to solve… Versus like shiny object, YouTube here, somebody coughs over there. You know what I mean? Like, you’re on the problem, and you’re sort of iterating towards “Okay, next hurdle, next hurdle, next hurdle.” And then it’s two hours later.

Yeah, no, I would agree with that. And I do find that the biggest problem I have is coming off of that. Like trying to transition out back into real life takes quite a while.

Oh, yeah. You need a buffer there. You need like a little cool down.

Yes, exactly. During the pandemic this was a problem, because I would usually go to coffee shops, and do stuff, and I would kind of have a built-in buffer. And then during the pandemic I couldn’t. And I found that – when I was done with work I had to commute, so I would just go on a walk around my neighborhood for like 20 minutes, and then come back, and my brain was all cleared. So yeah, maybe I’m just like overestimating what the flow state has to look like.

You’ve romanticized it. It’s better than you think you get to…

Yeah, exactly.

“Can’t quite achieve that greatness… That’s for those [unintelligible 00:50:26.00] discovery coders. The good ones.”

Yeah. Yeah.

Well I have another way of describing it, which I think is apt… I just think of it as being locked in. Like, it takes a while to get there, but finally, whatever combination of environmental impacts, and time, and your brain [unintelligible 00:50:47.10] to a point that you’re locked in on your current problem, or your current task, like Adam says… And you’re focused, and everything else is kind of secondary or just disappears for a little while, while you’re actually putting all of your thought into that one problem. And yeah, you may be struggling through that, because it’s a hard problem.

Some of us, Jimmy, just focus on the easy stuff. You know, life’s good. When you set the bar low, you can just limp over it. But locked in I think is what I picture for flow state. Everything else kind of melts away for a little bit, and you can just push forward.

Yeah. I think if I’m trying to bring this back to discovery coding and be maybe a little bit pedantic, I do would say if I’m trying to defend my own notion, I’d want to separate those two things. I think you can do discovery coding and not get into flow state, and I bet you there’s a bunch of outliners being like “But the outline is how I get into my flow state. Because I know everything I’m working on, and that’s what lets me get rid of my distractions.”

No, I would definitely agree that these are different things.

Yeah. But I do think it can lead to that.

Well, Jimmy, while you’re defending and differentiating, you also take some time in the post to differentiate discovery coding from bottom-up design, or bottom-up coding, or whatever.

Versus top-down. How do you distinguish that as being different than this?

[00:52:15.04] Yeah. So the way I understand top-down design and bottom-up design is… Bottom-up is you’re trying to build these kind of little Lego pieces, right? You’re trying to get something that’s interconnectable. You’re not immediately solving some specific problem. Instead, you’re making the building blocks to solve lots of problems.

Top-down is kind of the opposite. I think the classic top-down is like you start with your main method, you’re like “I’m going to have this object, and it’s going to have this method, and the method doesn’t exist yet, so I put an empty method body. And then that method calls these methods.’ And you kind of try to solve the problem, taking like, as you scope top-down, you scope in on the details, and you fill them out.

When I mentioned discovery coding to a coworker right before I wrote it, he was like “Oh, top-down versus bottom-up.” And I was like “No. I get where you’re coming from. But –” At first I was like “Maybe I’ve just reinvented the wheel here. Just coming up with a new name for it, and had a little moment of crisis there.” But once I thought about it, it’s like, no, I think this is usefully different, because I think you can go into a bottom-up approach with kind of that Lamport-esque setup. You come up with a little calculus, you come up with a little algebra of problems. You’ll see Haskellers do this kind of stuff all the time, where they come up with all these little parts that they’re going to compose together, and you like pre-plan ahead of time how you’re going to do this. And then you compose them up; you go start coding and doing this.

And what I wanted to emphasize with discovery coding is this kind of emptying of your mind of a solution. That’s what I really think is the mark of discovery coding, is that you’re not just approaching code trying to solve some concrete issue. You actually might not even have a problem, or a bug, or anything like that in mind. What you have is attention. People are not happy with how this thing is working. There’s all sorts of issues with it. There’s this bug over there, there’s this performance regression here, there’s this ugly code there that every time we touch it, it kind of breaks, there’s some security issue over there… Like, you’re just coming with like a whole slew of situations. And you don’t know what you’re going to end up coding at the end of it. You’re just trying to make it better.

And so you approach it not with like “Hey, maybe if I tried this, it will work.” Instead of approaching it like “Okay, given all this circumstance, all this problem that’s going on, where can I first make a change in the system?” That’s how I approach it. It’s like, where can I poke at the system? Maybe it’s just, I don’t know how that subsystem works, and I know it’s had lots of problems recently. Maybe I make a little debug interface that just like prints out the state every time it changes. And I start looking at that and I’m like “Oh wait, what’s that? Why is the state changing this way?” And I’m like “Okay, well, how does it relate to that thing?” And you’re just starting to connect dots, so that you can come up with “What am I going to do next?” And I think the result of that process might be a top-down approach, might be a bottom-up approach. It might be you go write a doc. But it’s that process of discovery. That’s why I liked discovery coding, because you are trying to learn something. You’re not trying to do something.

Break: [00:55:47.28]

How do you get started then? You said it begins with some version of a tension. You have tension out there somewhere in the system. And so when you start your day as a discovery coder, are you just trying to learn how the system works, kind of thing? Or you’re starting with that tension where you’ve got a sea or a slew of different problem sets that you’re just trying to figure out why that’s happening.

Yeah. I do think you’ve got to start with this curiosity of understanding the system. I think a lot of times, especially in day jobs, it’s very tempting to just solve problems you’re handed, or solve bugs that someone reported… And you can do that – if you’re a reasonable programmer, you can do that without understanding how the system works almost at all. You just look at like the isolated little part, you see that one variable’s off, and you try to recreate the behavior.

But where this always comes from is you want to have a more holistic understanding of the system, and you’re doing whatever it takes for you to understand that. For me, it’s often making a visualizer. It’s almost like marketing to try to get the job at Shopify working on Ruby’s JIT compiler. I spent a little weekend hacking in a live view of all the code that got JITed into Ruby. So I just kind of shoved a web socket in the middle of Ruby’s JIT compilation, and started sending code and graphs. And then I made a little web interface. You can see this on my – I guess it’s on my Twitter. That’s the only place I really posted this. Which, you know, sad. But anyways…

Yeah. So you can see that as you’re in like IRB in Ruby, and you’re typing code, you could see like code start compiling, and like graphs of it.

That’s cool.

And that was like how I started being able to understand this basic block versioning. I had read the paper on basic block versioning, which is the technique Ruby’s JIT compiler uses. I had read the paper on it, I had looked at a bunch of stuff, but it all just didn’t make sense to me until I made that visualizer. And I didn’t have like complete answers, but I started asking the right kinds of questions. Like, when do multiple versions of blocks come up? It all started because when I tried to visualize it, I just had assumptions… And then when I really tried to visualize this, it’s like “Wait, why is my code breaking? Oh, this isn’t unique. There’s multiple of these, and I didn’t realize that.” It’s things like that.

So it might not be visualizing it for you, it might be making a big bulleted list, it might be whatever… But the goal is to try to understand some aspect of the system that you didn’t understand before. And only then do you move to this “And now how do I solve a problem? What problems are there to solve?”

Compare that to test-driven development.

I have never – I just, I don’t understand people who… I feel like the people who love TDD have to be outliners. And if they tell me otherwise, I’m just confused.

I want to like it… I think it can be good. When I’m writing a parser, I often do kind of more a test-driven developmenty thing… Because it’s really easy to be like “Hey, I want this thing to parse.”

Right.

But usually, I only do that in a language that’s not like Clojure, where I can just immediately evaluate and see what it parses to… And usually, my tests don’t even have assertions. They’re just glorified REPLs. So if you need REPLs in Java, just write a test and run it, and put a breakpoint. But I don’t know, I guess it would be a question for people – if that’s the tool that really helps you discover things, great. I’ve never understood it.

[01:02:25.24] I asked because I’m not an ardent TDD-er, but I definitely have used it for that purpose. And then I’d just fall back on the tests as regressions, and – then I just have this little asset that I can hold on to, as long as it’s useful… Where I’m using the tests really to explore, more than I am to define the way something works… But I’m trying to explore a solution. Perhaps it’s an API, perhaps it’s a technique etc. And so I use the tests for that reason - kind of set up myself in an environment that I can just play in.

And yeah, I will basically use pry if it’s Ruby - or even Elixir has pry - which is a lot like you’re saying like “Get a REPL right here, with the whole world around me, and just play.” But then I’ll just leave the tests in, because now they’re like this little thing that goes green and I can prove I didn’t break anything later. But I’m not – I don’t TDD at all all the time, or for everything, so I’m not like strict on it… But I have found it to be useful for discovering things.

Yeah. I think that’s an interesting one, because I guess when I think of TDD, maybe I’m thinking a little bit more purist, of like you have to –

Red, green, refactor?

Yeah, yeah, yeah.

Yeah, I’m not purist. I do write the test before the code, though. So I think of it as TDD. Like, my test is driving out my implementation a lot of the times. But…

In this case though wasn’t it that there’s existing code that you’re writing new tests for?

Or there’s existing – a little bit of both. A lot of times I’ll be writing the test for new uses of the same code, or a modifying code, extending… So it’s not always greenfield, but a lot of times it’s for new code as well. But the test comes first, and then I write the code that makes the test work out.

So when you do this, do you find that you write the test kind of with like your given expectations, and then it turns out “Oh, the system doesn’t work the way I thought”? Is that kind of the goal of writing these tests?

Sometimes, yeah. Well, that usually happens more with an existing system that I’m trying to understand, versus one that I’m currently building. So there’s kind of two contexts. You seem to be a lot of times modifying a world that exists and is already gnarly… And so discovery is like top of mind. Oftentimes I already have most of the system in my head, and so now I’m extending and changing, and I’m making assumptions and make sure those assumptions are true or not, and so that’s the discovery… And then I’m, of course, testing out the code that I’m adding to the system as well. So there’s a little bit different mindsets there, I think.

I’ve only ever come into a system – like, remember your best/worst codebase conversation… Like, I’ve had one of those that I was just comparing it to the whole time. But mostly – because I did rescue projects for a while. Ruby on Rails rescue projects contract years ago. But most of the time the systems that I’m working on aren’t so unknown to me that I need to do too much discovery, except for when I’m trying to discover a solution perhaps to something new, you know?

Yeah. I do think discovery coding probably is more valuable in those contexts, where the system is too large for you to keep in your head at one time, or like there’s an external system that’s complicated enough that you can keep your system in your head, but like the interactions with that other system are complicated enough that it’s like “Wait, what is happening with all of that over there?” I do think those are probably the points where I’ve found it, at least for me, I’ve found it to be most valuable, is when – I mean, even for code that I wrote all myself.

[01:06:10.19] Like I said, I’m building this programming language… But I’m interacting with like machine code, and how it works… And I don’t have that full understanding of like the details of ARM, and how these things are supposed to work, and when you have different flags set, and etc. And that’s the point where I find these things really interesting. Either where you don’t have the system all in your head, or you’re like interacting with something that’s chunky and difficult.

Is every time you sit down to code a discovery coding session? Because you are a discovery coder, is all you do discovery coding?

I wish… I wish it could be.

[laughs] When he was younger it was…

I find it the most enjoyable. When I can, I like coding, and when I can’t, I hate it.

Describe. Like, give me the version that you don’t like.

Yeah. It usually happens at work, because otherwise I just wouldn’t do it. So you have some change that somebody else has come up with the details of how you’re supposed to implement it, and they hand it to you and tell you to go implement it… Or you have this bug that - yeah, you know it exists, and it should be fixed, but in order to fix the bug now there’s 1,200 breaking integration tests, and you’ve gotta go fix all those integration tests, and you’re just sitting there kind of doing rote work…

So much of the day job of programming is the unsatisfying parts of it. What I try to do is I try to sneak in discovery coding into some of those bits. I try to use them as an excuse to like under– “Oh, there’s a bug in this part of the system? Yes. I could just fix it by changing that one line that’s obviously wrong… But what if I were a more junior developer and didn’t just immediately know that that one line was wrong? What would I do? Oh, I would go learn all of this stuff, about this part of the system, and discover that that one line was wrong.” So I’ll try to use it as an excuse. You could think it’s maybe a bit self-indulgent, but I think it pays off. I’ve had so many times where me knowing a part of a system that I didn’t have to know, strictly speaking, paid off in the long run for the company.

Is there an example of that where you knew that one line was the fix, and you went and discovered that it was that plus?

Yeah, I’m not sure if I have like a good, concrete example… The thing I talked about in my article, about how I – did I mention it? I think I did. I debugged one problem for like two years. And it turned out to be this bug in some third party system where we turned off a cron job… But I was told over and over again when I was solving this problem to stop debugging it, and just go write some quick hack that will fix the side effects. And it turns out that that root cause of that bug was actually the root cause of 30 separate bugs that we had in the system, that were action at a distance, all complicated, all weird… And had I listened and done what I was supposed to do by my boss telling me to do it, we would have never solved all 30 of those problems. We would have only solved a handful of them. And so like I knew the quick fix for each of them, but only by like being willing to go “I want to understand this whole system. I want to go and dive into Gilfoyle’s code.” I almost said his real name. Guilfoyle’s code and see all of his craziness.

He’s back…

Yeah. Like really feeling that pull, that’s how I was able to solve all 30 of them at once, instead of duplicating my effort every single time.

[01:09:59.10] Now, did you go into your boss’s office that day and pick up a microphone and then drop it right in front of him?

[laughs] I’ve found – general advice to more junior programmers… If you do something really great, but someone told you not to do it, just don’t tell them you did it.

I used to brag about those things, and I’ve found that –

So personal satisfaction… You know, you get to tell a cool story on a podcast.

Exactly.

But don’t mic drop your boss. When you said “I’ve been disobeying you for two years…”

Exactly. People don’t usually like it –

“…and it paid off.”

…even if it paid off. It just makes them feel like they were stupid. That’s usually the outcome. And you’re trying to show them that they were stupid. “You said not to do this, and I did it, and look at all this stuff that paid off.” So you just keep it a secret.

Just keep doing it. Just keep solving the problems, basically. If you can live to tell another day, or live to discovery-code one more day.

Yeah. Don’t do what you’re told, do what’s right.

But what if you were wrong, and you never figured it out after all those years?

If you do enough discovery-coding, you’ll discover. [laughs]

With enough eyeballs, all bugs are shallow, that kind of thing?

Yeah, yeah, exactly.

Just open-source your code of the world and somebody will find it for you.

Uh-huh. That that’s good advice. If you’re in a company and you have a problem, just open-source all their code, and then someone…

I know somebody who did that one time, and it did not end well.

Really? Someone just like posted a bunch of that company’s code?

I can’t tell you, man…

Okay, okay.

Okay, I can tell you. I can tell you. Oh, my gosh… It’s been so long since I thought about this, but this is one of those stories. I won’t name names… Let’s just call him Dinesh. It’s Gilfoyle’s sidekick. Dinesh got a side gig, too. And I’ll say our main gig. Dinesh got this sketchy side gig where we were building out a system… And in our main thing, our consultancy, we were building out this template, let’s just say. And we wanted to keep improving that. And that template was open source. But then in this side gig we were doing some things that would make the template we did in the open source better. So we wrote the code for them, but decided to move that code over to here. When I say “we”, I mean Dinesh did this. I didn’t know that. And we had a company together. And it turned into a legal situation. It was bad… And it was the one time I was fired because of somebody else’s stupidity, basically. So Dinesh open-sourced somebody else’s code.

I mean, it’s simple boilerplate stuff. It’s not like you couldn’t rewrite it differently… But it literally was copy and pasted. Like, it was, line for line, the same. And the company found out and they were upset. And they were the kind of people that you don’t mess with. The kind of people that the moment they find out, they’re not like “Oh, you’re fired.” It’s more like “Oh, you’re fired. And here’s my attorney, and they’re calling you right now. And don’t ever talk to me again, because now you talk to them.”

Yeah. So that’s my short story on that.

Was it the Italian mafia?

You know what? I would never mess with it again. [laughter] Even mentioning the story I’m a little nervous, honestly… [laughter]

Oh, no. We’re gonna get a cease and desist from a lawyer…

I’m a little nervous. I’m a couple of LLCs buffered from that, but I mean… You know, that doesn’t exist anymore. That book is closed. It was very scary, because I’ve never been involved in that. I’m not a sketchy guy, you know?

Let me tell a similar story that’s lower stakes, because it’s college. I had a group project one time, four of us in a group… And this is for like a management information systems project. A whole bunch of writing, no coding; all outlines, no discovery. And one of my teammates – they just assign you partners, you know? And there’s four of us. And he’s like “Don’t worry about it, guys.” It’s like a semester long project. “I’ve got the whole thing taken care of. I’m just going to do it.” And I was lazy and young and not very discerning and I thought “Awesome. Check it off my list. Done for the semester” on that particular project.

[01:14:15.05] Well, the end of the semester rolls around and we all get dragged into the teacher’s office… Guess who plagiarized their entire project? Me alongside three other people, because the one guy who was willing to do the whole project just plagiarized it. And man, that was a rough day for us. Guilty by association, by negligence. And so that’s why I was nodding along as you got dragged into that when your partner made a really bad decision and you were hitched up to him, man…

Oh, you know… We live and we learn.

Going back into discovery coding, I’m curious how it works from sessions. I imagine – you said you had that REPL open for a month, or whatever. How does it work, or how do you get back into what you don’t call flow, what I might call flow? How do you get back into that zone, let’s just say, to be effective, back into discovery mode, from yesterday’s session to today’s session? What do you do to get back into that groove?

Yeah, this is something that has been evolving for me for quite a while. I occasionally watch Jonathan Blow do his live coding on Twitch. I don’t know if you’re all familiar… Braid, The Witness, two games that he made… He’s also making his own programming language, Jai. He’s a very talented programmer. Braid and The Witness were all built from scratch, and he’s working on a third game now, that’s also – the game engine was built in his language that he’s building.

Did you say Braid?

Yeah, Braid and The Witness.

Okay, I played that one.

Yeah, if you haven’t played The Witness, I definitely highly recommend it. It’s a kind of a puzzle game, almost kind of like a spiritual successor to Myst, in some senses, just in that like it’s a beautiful environment that you walk around; it kind of has that little feeling.

But very different in terms of like the actual gameplay. Really great game. Honestly, it’s a little bit of more like an artsy kind of game. So I definitely recommend spending some time playing it. And he does these live streams, and he’s just like – I will just go ahead and say, I don’t agree with all of Jonathan Blow’s opinions. I always say this every time I mention Jonathan Blow, because he can be a little rough around the edges at times. But watching him program is really interesting. And one of the things that he gets to do that’s very different from what I get to do in my day job is work on very long timescales. He’s building this game for like a decade. And these codebases are evolving very slowly over time… And he leaves these very like non-professional – I’m not saying they’re like rude, or anything. They’re just like very personal comments in his codebase all the time. They’re not trying to be for generic programmers to learn what this code’s about. They’re for him. They’re personal notes, scattered throughout the codebase.

And when he comes back, he can read these comments and actually like understand where his thoughts were at that time. And this is something I’ve been trying to evolve. I was very much like “Comments are bad. If you have comments, you should just like rename your methods better.” That was kind of what I grew up believing in programming. And I’ve gone the opposite direction, where especially to get back in the session I will always try to end each session writing one of those comments to myself.

Like, is it a sonnet, or a haiku? How do you write this?

Yeah, it’s mostly just like stream of consciousness. Like, every problem that I’m currently feeling, every bit of code that’s ugly, I try to write it down, like “I don’t like this. I don’t like that. This is working. This isn’t. I need to solve this problem. Here’s my current theory of what’s wrong.” That kind of thing. Because usually, I have to end these coding sessions very unsatisfied, where I haven’t solved the problem.

[01:18:09.01] Where do you put them at though, these comments?

Wherever my text editor happens to be open at the time.

Oh, okay.

Or I have a big to do .md and I also have a thinking.md that I have in this repo, where I just like put stuff. I don’t care if they’re ugly. I can always delete them later. They don’t have to stay around. But that’s how I try to end these sessions, and I’ve found it to be so helpful, because I’ll come back and I can hear like my own frustration and voice, not like professional, “This method does these things.” I just kind of ignore those kinds of comments, where if I see my own writing, I end up paying attention and getting back into that headspace much more. Especially frustrations. That’s the biggest one for me. Because it’s very easy to jump back into being frustrated. [laughs]

I want to talk about this more, but I want to mention an idea that you just gave me. Is there the concept of personal comments in a codebase? Because I mean, that made me think, I would love to drops comments that are *bleep* like that, let’s just say, like John does… But I don’t want Jerry reading those comments. They’re for me. But I want them in the code where the crap happens, let’s just say. Does that concept exist out there? I don’t think so.

No. This is a tool I’ve wanted to build for a while. I also am working on my own text editor at some point or other… And that’s one of the features that like is a killer feature to me.

That’s a great feature.

I want to be able to decorate code with my own notes, and make sure it works across revisions. That’s the only thing that you have to be careful about. It’s like, how do you make it so that even if someone goes and changes all this code, it properly anchors to the right places.

Yeah, that should be built into an editor, for sure.

Yeah, exactly. Like, leaving your own trails… And then you could even not only just leave your own notes that are for you, you could make your own notes as like a guided tour of a codebase, and hand it off to people. So you get like collections of notes, and then you could have shared notes. I think this is – we don’t use our metadata enough. I know that Git has a notion of notes, but everything I’ve looked at it, it seems like people are saying “Don’t use it, it’s not good.” But there is something built into Git, of like Git notes, that you can put stuff on. I will also leave big commit messages that are just my personal big dumps of thoughts.

Yeah, commit messages is as close as you get to that. What I like about it seemed like what you were saying is - and maybe John’s practices with them being littered everywhere is that they’re where the problem’s at, or where the angst is at, or even where the satisfaction might be at. Good, bad, ugly, whatever it might be, it’s where it should be, so when you come back to that place, it’s like “Oh.” And the reason why I asked you this question, how do you deal with sessions, is going back to Stephen King - one thing he does is when he sits down for the day, his daily routine, his process is reread the previous… I think it’s like X chapters. Like two chapters, chapter and a half. So he’s very much a discovery writer, if we wanna keep the brand discovery going… And so when he sits down for a session – and this guy’s notorious. Stephen King’s written 60 plus novels, 200 short stories… I mean, he’s world renowned as an effective writer, that’s skilled and has done a lot, and he’s written really great stories… Whether you like them or not. Subjective. But this idea to drop in these notes in different places, or to actually come back to the session with rereading where you left off at, these notes… Like, if I’m back here in line 120 - well, line 120 is where I’m gonna begin this process of it. But here’s the hairy monster I had forgotten about. But now that I revisit where I went, my RAM is full with what’s to come.

[01:22:08.09] Yeah. I think that’s a very important thing to get back into that context. I like the idea of going back and reading. I think it would be interesting to make yourself a tool that just looks at your last session of your Git history or whatever and lets you play it out, like a nice narrative of what you changed. But you can even summarize it or whatever, using an LLM or something. But I do think these comments kind of serve as that, because going back and reading all your old code… I mean, sometimes you’ll spend a few hours and you make like four lines of code change.

Right. I was gonna say, sometimes nothing gets into Git, right? Like, I’ve spent a long time and I’ve got nothing to show for it. But it doesn’t mean I didn’t make progress.

Yeah, you just debug. That’s what I spend a lot of my time doing, especially when you’re working with lower level stuff. You’re just trying to debug something that’s gone wrong. And writing down all of those theories is - yeah, definitely the key. So I like that. The Stephen King stuff, I might have to look into that; even though I don’t plan on writing a novel… I don’t know, there’s something interesting about learning how people do these things.

Yeah. I mean, he’s one of many to follow in regards to that. But I think you practice a lot of what he does. I mean, environment-wise, and not calling it flow, and stuff… I think it’s cool. I think it’s cool. I’m curious though if you did this personal note stuff, how that would actually work out… Because it seems like a really good thing that you can do, but it doesn’t really belong in the code forever. Like, some things might, some things might not… Because like you explain it, maybe it’s documentation, maybe it gets extracted to documentation… And there’s a lot of potential for this idea.

Yeah. I think you have to get it so that – like, the biggest thing I worry about with it is the UX, which is why when I’m thinking about building my own editor, it makes it much easier. Like, you could try to do like a VS Code plugin for it, or something, or you could try to do just like a – I even thought about building a command line tool version.

Oh, I have an idea for you. Sorry…

Yeah, yeah, great.

What if it layered on top?

Yeah…

Like, you know where line 120 is at… As an example; I used 120 before. What if you had an overlay that was on – like, your database was on top of the coding database… I don’t know if I would suggest that you write your own editor unless you’re just diehard. Because wow, getting people to change is so hard.

Oh, I don’t plan on anyone else using it. [laughs]

It’s just for you. Okay. “This is my editor. Literally.”

Yup, yup. Yeah, so one of the things I’m thinking of that I think makes this a little harder is like you want some things to be based on like line 120, but you want other things to be attached to this function, or attached to this loop, or attached to… And when do you decide that those things – if someone renames the function, how do you surface that note again? Those are the kinds of questions that I’m unsure about, is like as the codebase changes, especially if it’s not just you making the changes, how do you keep your notes attached to the right points and surface them in a way that you can see them?

It’s kind of like caring about the signs on a road that doesn’t exist anymore. Do you need to know there’s a hairpin turn on a road that doesn’t exist anymore kind of thing? Like, if somebody deletes the code, for example.

Well, what if they just like move the functions around.

Right. Rearrange, rename…

You still want that comment, but you don’t want it on line 120, you now want it on line 420, right?

Oh, yeah. [laughter]

I lived in an apartment 420. I just have to put this out [unintelligible 1:25:53.11] I’ve lived in an apartment that was apartment 420, and right across the hallway from me was 421.

And those people smoked weed like no other. And they definitely stole our sign.

[01:26:13.22] Did they really?

And we had to have a special sign…

“We’re the real 420.”

Yeah. We had to have a special sign that was not removable easily, like all the other ones in the apartment…

Like glue it down?

Yeah, so that they would stop stealing our sign. We ended up giving them a nickname…

It was just too funny. They couldn’t help themselves.

We ended up giving them a nickname, which was the 420 wannabes. [laughs]

That’s good. I like that.

But yeah, it was very frustrating to have them constantly stealing our sign. Like, come on guys.

I like the idea of this –

Sign stealing?

…this personal notes in the codebase.

You know who you need to talk to, Adam? You need to talk to Nathan Sobo and get him to build it into Zed, because somebody with an actual editor that wants differentiating features - that’s a pretty cool differentiating feature. They’ve got the horsepower to actually think through all of these nitty-gritty things, these UX things… And maybe they’ll build it, and then we can just use it. Because we’re not going to be able to use Jimmy’s, that’s for sure. [laughter]

I do think you could do this as a separate thing… The way I’ve thought about doing it, if you want to kind of go like the lo-fi route, like don’t try to make this real nice… It’s you write comments like normal in your normal text editor, but you just give them like a little bit of prefix, that says like “personal”, like to do, or whatever… And then just you run a command line script that will take them out before you commit things. So you write all – the only problem is you might forget.

Yeah, it’s just too manual.

Yeah. But if you want to prototype this, that would be the way I think you could start doing it. And then you can put them back in. And then what you can do is you can get those semantics of “Do you attach it to a function? Does it stay on the line? What if code changes across commits? How do you show these things?” etc.

You can also build a standalone app for it, put side by side.

Yeah, I was thinking of an extension which reads all of the notes out of some like git ignored file, which is like personalnotes.md or whatever… And in that file is where you actually store the notes, and they’re somehow linked to a file name and a line. And then obviously you can get fancier from there. And so when you boot up your editor, or start your project or whatever, it’s going to take that file, parse it and put them in. And then whenever you save a file, it’s going to like take them out, or make sure they aren’t actually in there, but they’re going to look like they’re in there… That’s as far as I got as we talked.

Yeah. The other thing that would make this –

We need to discover a solution for this. We can’t just make up for some.

The other thing that would make this a lot easier is if you kind of got rid of this text-based approach to programming. Maybe you go for something like – I don’t know if you’re all familiar with Unison. So Unison is a language that is being produced right now. They have like a Unison cloud, and all of this. And the idea behind it is your codebase itself is a big, immutable database. So when you make a function, you don’t store it as – say you have map. You don’t store it as the function map, as like “This is the name and this is the text I have.” You store the hashed contents of that function, and map is just metadata on top of that hash of the AST that you wrote.

And so your code is all completely immutable, and it’s all content-addressable… And so what you could now do is you could have very easily “Hey, I want to write a note on this map function.” Because it’s this hash. “Here’s my note attached to this hash. And what they do when you refactor, and maybe someone publishes a new version, is instead of having to be like “Here’s this version of a library” and I just get all the latest, you actually see “Oh, they changed map from hash one to hash two. Do I want to accept the new map thing? Oh, okay. Everything in my codebase that’s pointing to hash one, now I change it to point to hash two.”

[01:30:11.20] And if you have this kind of setup, it would be very easy to attach these kinds of notes as metadata. So maybe we’re just like – these are all the kinds of things that these more futuristic ideas of programming could unlock for us very trivially, and we’re just trying to shove it all onto text, and that’s why we’re running up against these problems.

Right.

I would call the ones that lose their home, so to speak - let’s say you do accept that change - just call them orphans. They’re just orphaned away from its previous. And maybe there’s – I don’t know if it has a visual or not, but some sort of snapshot of where it was. Like, “Here’s before this change was accepted. It was on line 120, it should have been on line 420… But it’s on line 120, and this is how line 120 was when the note was captured.”

Some sort of before and after state, but you’ve accepted it and now it’s orphaned, and so it doesn’t sort of get visualized in the editor and that actual line 120 anymore, because that world has now changed.

Yeah, that’s a good point. And then maybe you have some actions to be like “Hey, take this orphan and move it down to where it needs to be.” You kind of have to manually keep it up or whatever if it can’t automatically figure it out… But that seems reasonable.

And you might be like “Hey, this doesn’t matter anymore.” Maybe orphans are actually the ones that are easy to delete.

Yeah, but you get just like a little icon, a little thing that gives you like a count of…

No offense to orphans, of course.

…of orphans.

True orphans.

Yeah. My brain did say “Oh, if it’s orphans, you can have a little icon of like a crying child…”

Oh, gosh…

[laughs] …which just sounded really – no, don’t do that.

Don’t do that.

I was going to start singing “The sun will come out tomorrow.”

I like this idea a lot. I really do. I feel like this needs to exist. I feel like this is like the next frontier, or one of the versions of it. Because I think there’s some stuff in there that’s just like really good for the folks like you and Jerod and me. It’s like the discoverers that you kind of like want to use your own breadcrumbs. And not everything is public, especially whenever you’re like – it’s feelings. It’s subjective. It only matters – it really only matters to you. Your peers may actually reject these comments anyways, if they were true comments in the public codebase, let’s say…

Yeah. You could probably offend some people too, accidentally… Not because you’re writing something completely rude, but you’re like “I don’t understand this code.” You’re just frustrated at the time. It’s like “This is all garbage.”

Yeah. But it’s pertinent for tomorrow’s session, because if you want to pick up where you left off, you’ve got to put it down raw. You can’t, like, “Oh, it was amazing today, and this function is just so beautiful…”

You’re not going to leave that in there for the long term, though. You’re talking about things that you understand, or things that you don’t understand, that are long term, that you might come back to. Not my stream of consciousness from yesterday. I assume, Jimmy, after you consume that and you’re back at work, that comment can go away, because now you’ve refreshed your mind…

Sometimes they do, sometimes they don’t.

I bet you no. He’s a pack rat. He keeps this stuff.

Oh, yeah. Definitely.

No note left behind, is how Jimmy is.

I’m a digital hoarder, for sure. But you know, sometimes it’s like, you leave these notes knowing that trying to tackle that problem right now might be a mistake… But you need to remember that context. So I built a register allocator that was all really bad… And I was building it for my language, but it worked. It worked for everything I could find. And I left a big comment about all of the deficiencies with it, and how I thought it was probably going to break… And it was not until months later that I got code complex enough in my language that broke the way I was doing register allocation, that I went back to register allocation and read that comment again, that was kind of this frustrated, “Why am I doing this? Why is this all –” And then I like left at the bottom “You should probably – if you run into bugs, just actually go read the paper on linear scan register allocation and actually understand it.” And this last weekend, that’s what I did. I went, I read the paper, I actually understood it, I implemented it, and now that bug went away. But had I not left that for myself…

[01:34:14.20] That’s good stuff. That’s a good comment. You checked that in, right? You just left it in there for everyone?

Absolutely. It’s my personal project, so I can check anything in. But for work stuff…

You wouldn’t leave that in there if it was work code?

I would have to clean it up and make it professional, and then it would lose some of the juice…

[laughs] Don’t lose the juice, Jimmy.

I can usually hide those in commit messages. I’ve had co-workers message me and go “Oh, I didn’t know commit messages were for rants.” Because they’ll go like three paragraphs in and then all of a sudden I’m ranting about the problem. Usually people don’t read those, so you can get away with it… And I feel like a professional courtesy for leaving those when you have to do a hack, because someone eventually is going to get mad at you, and they’ll look at who wrote this stupid code, and then hopefully they see a big, long commit message and they feel better.

That can be your next blog post. You can go through some of your old commits and pull out spicy comments… Remember Taxi Cab Confessions? Remember that show on HBO? It’s like “Commit message confessions by Jimmy Miller.”

[laughs] But I do think this personal – I agree, Adam. I think this personal notes tool would be really nice. I do think you could probably build it as a plugin on various editors without too much effort. I think there’s some UX things you’ve got to think about, and some problems… VCs want to – I’m just joking. [laughter]

I was going to say, if any of our listeners want to solve a problem out there in the world, here’s a problem you could solve.

Yeah, absolutely.

And at least three nerds would appreciate it.

It’s got some legs, man.

Good, I’m glad to hear.

I think so. It reminds me of Field Notes. I’ve got a friend of mine who just swears by Field Notes. He literally keeps the Field Notes notebooks that Kudall Partners came up with years and years ago. He keeps one in his back pocket, and it’s like his field guide to everything. It’s place and time, where he’s at, who he’s with, note… And he pulls this thing out like it’s his own personal reference [unintelligible 01:36:08.24] because it is. And he pulls it out constantly to reference it for whatever…

And he keeps them all. It’s kind of like that, but in the digital for a codebase.

I have a little dog whining at me. Give me one second to grab her. This can be on the podcast or not, it doesn’t matter… But if I don’t grab her, she’s just going to keep whining at me.

It depends on how you grab her, you know? [laughs] There you go.

Oh, Jerod…

I was thinking like by the neck, you know… Like, “Oh, we can’t put that up there.”

[laughs] Well, you know…

“He’s strangling his dog…” Oh, hey, he’s back.

What’s the pup’s name?

This is Lemon.

Linen?

Lemon, like the fruit.

Good. I thought you said Linen, like the cloth. I was like “Weird name…”

No, no, no. Lemon like the fruit.

Lemon’s a good name.

She’s a lemon beagle. That’s her coloring. So…

But she thinks it is 30 minutes later than it is, so she thinks it’s dinner time… But she’s wrong.

See my pup back there on the couch?

Oh, yeah [unintelligible 01:37:13.16] but I see now, yeah.

It’s right there.

He makes a little appearance once in a while… He’s sleeping. He’s just hanging out…

Yeah, yeah. She thinks it’s time for food, but she’s very wrong. But the problem is when my wife’s home, she’s not as consistent at the time.

Gotcha.

Yeah, so… I get it. She’s confused. It’s fine.

So when will discovery coding become more than this blog post? Like, it’s got – I think this has got book potential. It’s got branding potential.

It’s got legs, man.

It’s like agile, in terms of its ability to change things.

I will admit that I haven’t thought at all about anything beyond the blog post… But it’s nice to hear.

When is your programming language going to come out then?

I am working on that. It’s a very long endeavor, I’ll say that. I have big ambitions for it.

[01:38:13.10] What’s it called?

It’s called Beagle, actually. I thought it would be fun… I can get a little mascot…

That dog hunts.

They’re gonna call it Linen.

[laughs] But yeah, so it is called Beagle. It’s a dynamically typed language, which I know is like controversial right now…

Not for me. I like them.

It’s functional. And the goal is for it to be fast and multi-threaded. Multi-threaded is a very direct thing. I think all of our – that’s the problem, all of our dynamically-typed languages right now are a little too old. All the popular ones… They’re great. I don’t have anything bad to say about Ruby, Python, JavaScript… But they all kind of are from an era where we – we learned lessons since then. One of those lessons, in my opinion, is multi-threading is good. And if you want to really use all of a modern computer, you need it. So I’m starting with that from the beginning.

And then the other thing is like VMs are really, really complicated, and trying to like after the fact patch on JIT compilers, and all sorts of things just takes either a lot of money in the case of like Node and V8 and all of that, or just a lot of time and effort. Look at what Ruby and Python are doing… So I started with just compile the machine code from the start. And you know, it’s proof of concept. It’s very early days, but…

What kind of machine code? Like, specific processor…?

Right now, I just have it working on my Mac, so it’s ARM. But making an x86 backend won’t be too hard.

Gotcha.

But it’s like definitely in the hobby project stages right now. But I have multiple garbage collectors that are plug and playable. I have a generational garbage collector, a copying garbage collector… It has namespaces, it has closures. I’m getting some real code in it now. It’s finally at that stage. I’ve written like 2,000 lines of code in the language itself.

Okay…

So it’s getting beyond just toy, which is fun.

Very cool.

But it’s way – I’ll probably never finish it… I’ll just make it the one level of ridiculous. Why I have this language is because I built – I have a blog post where I built an editor in Rust, that is up there, and I talk about all the problems with it… And then I built a second editor in Rust, that I still haven’t written the blog post for, where I made all of the plugins WASM, and you could like hot code with WASM, and hot reload all of the plugins… And like the whole actual editor part was in these WASM plugins. And I absolutely hated it, because – like, WASM is cool, but it’s not meant to do hot reloading constantly. And so I went and built a programming language just so I can go build my editor.

Okay. So the editor and the language will ship at the same time, kind of thing?

Yeah, it’s all levels of ridiculous, and I don’t expect anyone to ever use it… But I’ve learned a lot. I highly recommend, like, just go reinvent the wheel and build stuff that you’re never going to ship. It’s great.

They always say don’t do that. You’re saying do it. [laughter]

Jimmy’s like – he’s counterculture, man.

Yeah, yeah. This is – okay, this is a blog post that I will write at some point soon, which is I think we have overindexed on the values that are good for our day job, and start applying them to our everyday life when we’re coding, and I think this is a big mistake that we’re doing. In your day job it’s often not good to reinvent the wheel. You should just pull that well-used library that everyone knows. Don’t go make your own frontend framework. Use React, use Svelt, whatever you want to have. It’s fine. I’m not going to be partisan here. But in your day to day life, when you’re coding - yeah, reinvent the wheel. Use your own framework. Do whatever you want. Because all of those values are made for the company. They’re made to make money. And if that’s not your goal, if your goal is to learn and have fun, we need to ignore all those values that we keep shoving on.

[01:42:18.08] I agree with that, man. That’s the living. Some people want to – that’s almost like the safe road. To not reinvent the wheel is the safe road. But it’s not the road that you go down to learn how a system works, or why, how you would even do it in the first place. There’s so much learning in that. That’s why I love to homelab, personally. I get to solve problems that I don’t even have at work, let’s just say. I manufacture problems. I create problems, I break things.

Exactly. [laughs]

And then as a result, I’m like “Well, dang, that’s stupid. Why does it work like that?” But now I know, and I’ve got my own documentation that’s bifurcated, away from the codebase, which is like “Come on, Jimmy. Solve that problem”, you know?

[laughs] Yeah. You just brought up a great point. The personal codebase, personal notes - I’d also love to take notes on other people’s codebases. You’re trying to solve some problem with your homelab, and you’re digging into some open source server and it has some weird bug in it… Like, just take notes for yourself. Yeah.

It kind of should be – it should live in the repository. It should like carry with the repo.

Yeah, you – should it live in the repo? I know we’re product-designing this now, but do I even want it to possibly be public?

Well, I think it doesn’t have to live in the repo. If GitHub is always GitHub, and some URL, github.com slash whatever .git exists, then you can always assume that will exist, and you could build that layer on top. Assuming that truth is there and that foundation remains the same… The API may change a little bit, and you can always ebb and flow as a result… But if that remains a truth that we developers live in, then you can build that system on top.

Yeah, I think going to the git SHAs to make sure that – you know, the points in time… That for sure. I think it’s a no brainer. But I think I – I mean, I think maybe you should have an option that you store it in your git, like using git notes or whatever. But I would also want to be able to be like “Nah, that one was too spicy. I don’t publish that at all.” [laughs]

Like “Oops, I made that one public.”

Exactly. I don’t want that – or you publish it encrypted in the thing… Public/private key signed… I don’t know.

It’s like, “Come on, don’t do that…”

“Are you sure you want to drop this spicy thing publicly?”

Yeah, yeah. Maybe you can have shared ones as well, and you can host those as like text files in the repo… There’s all sorts of ways you could do it.

Well, there’s your SaaS plan right there.

Yeah… Oh, that’s good. Don’t let people post it in the repo at all, so that way it’s as a service.

That’s right.

Exactly. Personal notes as a service.

Use the cloud.

Right. You’ve got to control the data at all moments.

And then you get bought by Evernote, and that’s your exit plan. Bam. [laughter] Does Evernote still exist?

I was gonna say, does Evernote still exist? That was literally my question.

I don’t know, honestly. It was huge back in the day.

It still exists.

Okay, cool.

Does it still do what it used to do, or they’ve pivoted like 12 times or something?

I don’t know firsthand. I recall seeing somebody talk about how they still use Evernotes. And I think it was actually the guy – no, I don’t know what it was. It was somebody promoting Obsidian, and using it as their second brain. And I think they were like talking to somebody that was coming from Evernote… And yeah, it still exists, and it’s kind of the same.

I hadn’t heard of Evernote in a long time until I just said it. I was like “Dang, is that a thing anymore?”

Yeah, I remember when it came out it was all exciting… But it’s one of those things.

Oh yeah, because it would OCR for you. That was probably the reason, right?

[01:45:54.07] You’d take pictures and snap it in there and it would OCR it… And that was the first consumer app that would do that. Plus it had a cool elephant icon… That really got it going.

Man, speaking of that, ChatGPT will OCR very well. I was just doing that… I mean, I was messing around, and for whatever reason, I just didn’t have my laptop near me, and all I had was the machine that I was messing with. Monitor, keyboard, mouse etc. and my phone. And so I’m at the command line to deal with some stuff, and I can’t go to the internet because I don’t have another computer. All I have is my phone. So I would like take my phone out, take a picture of the screen, “Here’s this issue”, throw that in ChatGPT, and it’s like “Oh.” It would read it as if it was like the terminal. It’s the coolest thing ever.

You know what else does that now? QuickTime Player.

Is that right?

Yeah. If you are watching a movie and maybe the credits are rolling, you can just like select the credits and copy and paste. It’s so cool.

Yeah. Apple has it pretty much for all texts and images. It’s really funny, because it used to be like sending screenshots was one of the most frustrating things anyone could do… And now I’ve found things where like “I can’t select that text. Oh, wait, I’ll take a screenshot of it, and now I can select the text.”

I just did that today, actually. I just did it today. A couple of times. “Let me screenshot this, so I can select the text.”

It’s so cool.

Yeah, life really is getting easier after all.

So one thing I noticed with this discovery coding, though, is that you’ve described it, you’ve prescribed it, but you haven’t defined how to begin. Like, if there’s someone out there thinking “Dude, I want to go down this road. I think I’m this kind of –” Maybe they already are. But if they’re like “I want to discover discovery coding.” How will they do it? How do you begin?

Yeah, I think that might be a good – you talked about “How do I take it out of this book?” It’s a good follow-up maybe that I can do. But I think the key to get into discovery coding is to be willing to not have a solution in mind. I do think that that is easier said than done. I think it’s very, very tempting anytime you’re approaching programming problems to come with solutions. And I don’t know, it sounds almost silly when I say it, but I’ve found that to be the number one thing that stops me from finding the good solutions, is that I already have a solution in mind, even if it’s just in the back of my head, and as I’m going and doing this, I will just automatically go towards that solution.

So step one, clear your mind, meditate… No solutions. Step two I really think is ask questions. Ask questions about the codebase, about the problem, about whatever it is that is this situation you’re in, and try to find the answers for those. And if the answers are frustrating to find, if it just takes too long to find them, build a tool that makes it really easy. And if you start there, the process of discovery coding will start becoming the easy default, because every time you want to have an answer, you already have tools available to you to help find that answer, and that ends up being like your inspiration for how to continue.

So the goal is to try to make it easy to discovery-code, because if it’s not, you’re never gonna do it. So you kind of have to do the hard work up front.

Bootstrap it.

[01:49:22.09] In my language I had a bug. I had no idea what the bug was. Literally none. When I was running code, all of a sudden, it would start returning data that like was not even part of the struct that I had, or whatever. It was just like all of a sudden arbitrary data. And every time I would run it, it would be consistent. So I was like “Okay, I clearly have a bug somewhere.” So I spent all of my time building my own really terrible Compiler Explorer, or Godbolt clone… If you haven’t used Compiler Explorer, check it out. You give it code on the left, and on the right it spits out assembly, and it shows you how it connects between the two.

So what I did is I made my code, my intermediate representation, IR, and then machine code that was disassembled on the right, and I made it so like when I hover over it, it shows me the IR, and then it shows me the machine code. And it’s an awful tool. It’s the worst put together thing I’ve ever written. But it worked. It worked. I got it so that my program output that. And I looked at it and I was like “Now I will be able to discover the bug.” And I looked at this tool, and I kept looking, and the bug was not there. And what I learned is that the code that the tool was showing me, and the code that was actually running were two different bits of code.

Not the same code.

And what I realized is when I’m writing code to memory, I wasn’t keeping track of the offset properly, and I was rewriting over code I had already written. And when I looked at the – the fact that this tool showed me that “No, the code’s perfectly fine. Everything’s great”, and then I compared like what the distance actually in memory and what the tool was saying, I was like “Ah…” And immediately I knew where that bug was. I had discovered something about my system that I wouldn’t have discovered. I could have – I didn’t even know what the bug to begin with was. I had no idea. And I was like “I want to have something that will immediately show it to me.” And then I learned a lot about how my system worked by doing that. Even though it actually didn’t show me the bug. It showed me the absence of the bug. And that was like the funny part.

But now, since then, I’ve used that tool every single time. Now I have a tool readily available to me where anytime I write something and it’s wrong, I can go look at “How does it match up?” and that helped me with my register allocation. Like, now it becomes the default place to go.

I love it. I think that’s a good note to end on.

I love that note. Such a good note.

Build your own discovery tools, so you can start to discover other tools and bugs…

For sure.

Or non-bugs. It’ll still help you.

That’s right. The absence.

I would have stopped right there, Jimmy. I would have been like “See? There is no bug. I’m going to bed.” [laughter]

“I told you…”

“I knew it the whole time.”

Yeah. Look, I just proved that there is no bug…

That’s right.

So why keep telling me that it’s not working…? I think that’s the real method. You discover that you’re perfect, and that there are no bugs in your code. That’s discovery coding.

Yeah. Bye, friends.

Bye, friends.

Bye, friends.

Changelog

Our transcripts are open source on GitHub. Improvements are welcome. 💚

Player art
  0:00 / 0:00