Learning to Code With AI and Steve Klabnik ![rw-book-cover](https://wsrv.nl/?url=https%3A%2F%2Fimage.simplecastcdn.com%2Fimages%2F24832310-78fe-4898-91be-6db33696c4ba%2F5f3d9920-d9ed-4f6a-ba5d-77feba765649%2F3000x3000%2F1519419781artwork.jpg%3Faid%3Drss_feed&w=512&h=512) ## Metadata - Author: [[Hanselminutes with Scott Hanselman]] - Full Title: Learning to Code With AI and Steve Klabnik - Category: #podcasts - URL: https://share.snipd.com/episode/13012a43-20f6-4f3f-b984-2e6fbdb1ec08 ## Document Notes ## Highlights - **Steve's AI Skeptic to User Story** - Steve Klabnik shares he was once very anti-AI but changed his mind after trying Claude 4. - He now uses AI regularly for programming, finding it genuinely useful beyond a parlor trick. Transcript: Steve Klabnik My like opinions about AI is I was very anti until a couple of months ago. I was like, like absolutely. You were that person. Yeah, I was that person. And that's partially because I had tried it when it first came out and I thought this is a fun parlor trick, but not really much more than that. And the problem is technology updates itself pretty quickly. And so essentially it was the release of like Claude four. And I was like, you know, I want to be an informed hater. So I should like actually give this like a real try again. And then I was like this is good actually and i kind of like it and so it became this really big like you know thing so so anyway there's also there's also that so i'm not trying to like uh you Know besmirch anyone's opinions you should have whatever opinions you want to have about this stuff but i do think that like yes for coding is a very different question than for other Things the video stuff i like agree that i think that that's some areas it's interesting math problem i think that like the way they're kind of going after video games is kind of interesting Like can we respond and you know with it to in semi real time to like players trying to move throughout a space but again it's like interesting you know the other big story today is like Related to that i don't know this is not going to be out literally the same day but uh grok has a spicy mode and it made naked pictures of taylor swift and like yeah i saw that a couple of hours Scott Hanselman Ago so like yeah yeah when did responsible like like my i work at microsoft in my day job and i'm in a lot of meetings and in every meeting like okay let's talk about where responsible ai Fits in like nothing goes out without a filter on front it's effectively a firewall yeah how does grok let that content in and then once it gets in and it makes something naughty why is Steve Klabnik It being allowed out like that does not seem okay by any means yeah and it's i think it's like you know i don't i don't want to say taylor swift doesn't matter i'm not here to argue the swifties And she is also human. So it doesn't matter on some level. Scott Hanselman As a member of the Beehive, I can recognize what Swiftie feels like. Steve Klabnik But I think that like celebrities have a certain amount of like understanding that they are looked at by everyone in a certain like way. You know, like this isn't, while it is new, while it's like, while it's a thing and it's bad, uh, I think that like the fact that this technology becoming accessible so that like, for example, Normal people who are not up on stage in front of thousands of people can have deep fakes made of them. Like, and that kind of stuff I think is going to be more like societally a problem, even if like, again, just to be clear, it is a big problem. And I hope she sues and takes all of Elon's money. Like it's not an okay thing to do. But I think that like that happening at scale is the thing that I'm like ([Time 0:04:12](https://share.snipd.com/snip/e55d1273-0ec1-441b-beb2-e9d75bcf93be)) - **Source Code as Copyrighted Book** - Copyright laws treat source code like books, not recipes, making it copyrightable. - This decision greatly shaped software development and licensing as we know it today. Transcript: Scott Hanselman Alone in their studio apartment, throwing paint at a wall, and then I can train something in a weekend on their 20 years of style and then generate that, that's a thing. So then the question is, can I write kernel code now as good as Linus does? Steve Klabnik Yeah, I, it's, it's definitely very interesting. Do you, do you know about the history of source code and copyright actually? Cause it's like kind of a story, right? It was almost, for those of who don't know, essentially 1978 was the big copyright act, right, I think. And essentially software was just becoming a thing when it happened. And effectively, they needed to get the law passed, but they were like, we clearly need to address the software thing. And so they set up a commission that was kind kind of patch the law. And later the law said like, and we're going to start a commission and they're going to investigate the question about software. And that's because like recipes can't be copyrighted. They're, they're just, they're things that exist. You can't copyright them. This is why everybody talks about, you know, their wonderful trip to, you know, whatever to get, you know, that's all because that text is copyrightable, even if the recipe is like not Right. But like also novels and books can be copywritten. And so the question for that committee was kind of like, is source code closer to a recipe? Cause it's sort of like a recipe for the computer or is it like a creative work, like, like a book? And so they kind of came down on the side of, you know, okay, this is like a book and it should be copyrightable. But there was a moment where like, we almost didn't even have those at all. And I think that's a really interesting kind of like, what if, you know, how things would be different if that had changed. But yeah, so like, I'm also a little skeptical of copyright in general. I think I kind of, you know, being an elder millennial came up during a lot of the like, you know, information wants to be free kind of like, you know, Napster era kind of like attitudes. And I think it's really interesting how like, because copyright is one of the only sort of like effective tools that people have around these things, it seems like a lot of people are Really interested in strengthening copyright. And I don't think that's like really great for society necessarily either. But it's like, it's also true that I want people to be able to make livings from creative work you know i was talking with somebody about this recently and he was saying like you know i really Want like a band to be able to like uh you know make make a living and so i feel like if anybody uses their style of music they should have to pay them and i was like well scenes happen when a Bunch of different bands that kind of sound similar ish you know like play off each other and build something better and you get like more music out of it. And so if you required like the first punk band to be paid every time the second punk band played a show, like you wouldn't have punk music in the same way that we do now. You've got to find a way to make people have a living, especially people that are doing creative works. But it's also not true that people being able to solely own creative works is a good thing for society. And balancing that is what copyright tries to do. I don't really know if it's up to the task of this kind of future, I guess. Yeah, so that's one way I think about this problem. Scott Hanselman Yeah, like pre-1970s ([Time 0:08:56](https://share.snipd.com/snip/c3b224ce-0aa6-481e-8705-dbaa6e35ac2a)) - **Software Was Once Shared Service** - Before the 1970s, software was a shared service bundled with hardware, not a sold product. - The 1978 copyright act changed this, redefining software ownership and fostering open source movements. Transcript: Scott Hanselman It wasn't a product it wasn't sold separately you'd buy a mainframe you'd buy a fridge from ibm and it would come with the source code and you would share it and it would be totally open And academia or working at nasa you know early hacker communities it was all shared and then that when that commission happened the Commission on New Technological Uses of Copyrighted Work, it took six years for them to decide that this was a thing. And then, of course, that literally in reaction to that, Copyleft and GNU fired up. And it's still to this day, there's OSS and there's FOSS. And then there's now a rebranding with dual licensing, which can be super confusing. And I want everyone to be happy and have food. Yeah, yeah. That's it. But at the same time, I was on a – I don't know if you know this, actually. This might be interesting for you to know. I was an expert witness for a patent troll case. And a patent troll had designed effectively an ATM machine. And in the creating of this kind of ATM that ([Time 0:11:58](https://share.snipd.com/snip/a44b89bb-b8e3-4426-874e-d13879e82222)) - **Review AI-Generated Code Carefully** - Review code generated by AI tools to ensure quality and correctness. - Maintain professional responsibility by carefully merging AI-assisted code in serious projects. Transcript: Steve Klabnik No disclaimers, like as is, sorry, that's it. But like culturally we expect there to be some sort of like place to talk about things. And like, there should be some sort of like way to make decisions. And like, there's all this social kind of like building stuff that I think that, you know, the kids these days kind of understand to be what open source is actually about and they don't Really like think about licensing the way that i think some of us that are a little older that had to kind of like deal with a lot of that stuff kind of do because you know like and there's It's also true that like i do this as well like you know i want to support the projects I mean, I don't do that. I don't support that many open source projects anymore. But there was a while where that was like all I was doing. And like I was putting a lot of effort into giving that support. And like I never actually technically had to do that. But I kind of felt like socially it was the right thing to do and also a good thing to do. And but like I would stress myself out on a thing that I've technically said, like, I don't have to support this at all. Like just deal with it you know but i was burning myself out trying to do that stuff and so i think it's like a little tricky basically ([Time 0:14:41](https://share.snipd.com/snip/b905cb43-578c-4845-b468-b84d67faff3a)) - **AI Debugged Compiler Segfault** - Steve Klabnik had Claude fix a segfault by analyzing gdb debug info and object dumps like a human. - AI could identify and fix bugs after investigating outputs and backtraces just as programmers do. Transcript: Steve Klabnik You know, doing something and so but that's definitely a problem um and we like use gdb and we're looking at the stuff and we're looking at backtraces and we're using object jump to like Look at the actual like output assembly and it's like yeah okay this is what's messed up cool and then i tab back over and look up the window and claude was like i fixed the bug and so i tried Running it and the program ran and it spit out a number as the exit code and i was like that's cool and i scrolled back through the history and Claude had invoked GDB to examine the binary. He had looked at the obj dump to figure out what was actually wrong. So it basically did the exact same steps that we did. And it found the thing that we found and also something we didn't find and then made it work. And so that was impressive. But also I've asked to do very simple things. I recently found in this sort of feature range I'm working on, it had decided that instead of calculating like offsets for structs, like, you know, struct.x ([Time 0:32:54](https://share.snipd.com/snip/bef053d0-b539-4c34-aa6c-5b17fc178246)) - **AI as Statistical Language Models** - AI models are statistical pattern matchers rather than truly intelligent entities. - This resembles human behavior, which also involves repeating learned patterns in communication. Transcript: Scott Hanselman And every once in a while it rolls a d20 and it's like and it runs over that direction because it's not smart like we it's it's amazing it's a miracle it is not smart yeah it's it's definitely Steve Klabnik I think sometimes it can be very smart and i think i've been trying to trying to think a lot about what what do i think smart even means like i'm in a space i I'm like, what does thinking even Mean? I'm not actually sure anymore. Scott Hanselman I guess what I'm saying is not intrinsically smart. I don't know. I've joked that maybe I'm just, people listen to the show and they're like, oh, there's another Hanselmanism. It's like, I'm just a statistical model. There's the same five things that Hanselman says. We all have our things that we say that get stuck in our mouths. Steve Klabnik I have spent a lot of time around a two-year ([Time 0:34:55](https://share.snipd.com/snip/bf65fb52-57de-41b4-bbdb-540a12138226)) - **AI Revealed Outdated Code Comments** - Richard Feldman used an AI tool to refactor code, which also updated comments revealing outdated documentation. - This highlighted subtle code behaviors absent from type signatures and improved awareness. Transcript: Scott Hanselman Files and then I'll feed those into Cloud or I'll feed that into Copilot. Steve Klabnik And it's like, maybe I should just use a really precise grammar, you know, and then the slippery slope right back into compilers again. It's, it's, it's interesting. There was a paper I saw recently that like these tools will do better if you have good variable names. Like they took the same code base and they asked it to fix a bug and then they transformed the source code to have gibberish, you know, names and that didn't work. And it's because, you know, it's like doing correlations. And so if it, you know, sees something that's named a certain way, it's going to think that it works in a certain way because it's just the same way that we kind of like look at these things. And so I'm definitely having fun. I think that like the time I've had to be programming versus not has kind of changed, you know, in my life a lot over the last couple years, for sure. And especially lately, but I'm definitely enjoying it. I think that it's brought me a lot of stress because of the many of the people I know that are super anti these tools are some of my best friends. And I've already lost a couple of friends or at least been let's say like had very strong words exchanged between people that uh you know i thought were friends or not um based on my like Refusal to totally disavow these tools entirely and so i have several friends who are like working on projects that are pretty terrified to find out that you know who's going to get upset With them if they talk about their usage and so that part has put a damper on it but the actual like act of doing the thing yeah it's definitely been a lot of fun even when i do the spectrum And stuff like i will absolutely do sometimes you know do the whole markdown thing and i think that's also like a good uh a good strategy it's like kind of like a lot of things that are good For LMs also seem to be good for humans in many ways. And it's kind of interesting. I was on Richard Feldman's podcast a month or two ago, and he was talking about he had a comment on ([Time 0:37:55](https://share.snipd.com/snip/cf2f4101-dad7-4551-88ed-5a9e62acdddc)) - **Name Variables Meaningfully for AI** - Use meaningful variable names when coding with AI to get better results. - Clear naming helps AI understand code logic, making bug fixes more effective. Transcript: Steve Klabnik Like they took the same code base and they asked it to fix a bug and then they transformed the source code to have gibberish, you know, names and that didn't work. And it's because, you know, it's like doing correlations. And so if it, you know, sees something that's named a certain way, it's going to think that it works in a certain way because it's just the same way that we kind of like look at these things. And so I'm definitely having fun. I think that like the time I've had to be programming versus not has kind of changed, you know, in my life a lot over the last couple years, for sure. And especially lately, but I'm definitely enjoying it. I think that it's brought me a lot of stress because of the many of the people I know that are super anti these tools are some of my best friends. And I've already lost a couple of friends or at least been let's say like had very strong words exchanged between people that uh you know i thought were friends or not ([Time 0:38:15](https://share.snipd.com/snip/a9cd86d2-373b-4061-a262-338f4f4ae4c2))