Code, 2nd Edition: Begin Book Club

Simon MacDonald’s avatar

by Simon MacDonald
@macdonst
on

We had a great chat with Charles Petzold, the author of Code: The Hidden Language of Computer Hardware and Software.

Video

Transcript

[00:00:00] Simon MacDonald: Hey everyone. Welcome to the November edition of the Begin Book Club. Today we’re gonna be talking about Code, The Hidden Language of Computer Hardware and Software by Charles Petzold, who is our guest today. Just want to let everybody know before we get started that this entire thing is covered under the architect code of conduct.

[00:00:19] You can check that out by going to github.com/architect/architect and then look for the code of conduct. But the, you know, Coles Notes version of it is just be nice to everyone, treat people like you want to be treated, and I think we’ll all get along fine. Anyway, let me give you a quick bio of our author today.

[00:00:36] Charles Petzold is the author of over a dozen books, one of which Programming Windows Fifth Edition. Helped me greatly by teaching me all of the things about Windows programming that my professor completely glossed over during university. Honestly, Mr. Petzold, without that, sorry, Charles. Without that book, I definitely would’ve failed that class.

In 2018, Charles retired from a 34-year career in writing, thinking, and speaking about programming. And we were so lucky to have him with us here today to talk about the second edition of his book Code. So Charles, please take it away. As we do in our tradition, here is for the author to read a passage from his book.

[00:01:17] And I believe that you have selected something.

[00:01:19] Charles Petzold: Yes, I have excellent chapter 11, bit by bit by bit. A story dating from at least in 1950s, tales of a man traveling home after a stint in a distant prison. He doesn’t know if he’ll be welcomed back, so he requests a sign in the form of some cloth tied around a branch of a tree.

[00:01:41] In one version of the story, the man is traveling by train to his family, and he hopes to see a white ribbon on an apple tree in another. He’s traveling by bus to his wife and he’s looking for a yellow handkerchief on an oak tree. In both versions of the story, the man arrived to see the tree covered with hundreds of these banners leaving no doubt of his welcome.

[00:02:03] The story was popularized in 1973 with a hit song, and since then, displaying a yellow ribbon has also become accustomed when family members or loved ones are away at war. The man who requested that yellow ribbon wasn’t asking for elaborate explanations or extended discussion. He didn’t want any ifs, ands, or butts.

[00:02:23] Despite the complex feelings and emotional histories that must have been at play, all the man really wanted was a simple yes or no. He wanted a yellow ribbon to mean yes, even though you messed up big time and you’ve been in prison for three years, I still want you back with me under my roof. And he wanted the absence of a yellow ribbon to mean, don’t even think about stopping here.

[00:02:46] These are two clear cut, mutually exclusive alternatives. Equally effective as the yellow ribbon, but perhaps more awkward to put into song lyrics would be a traffic sign in the front yard, perhaps merge or wrong way, or a sign hung on the door, open or closed, or a flashlight in the window turned on or off.

[00:03:07] You can choose from lots of ways to say yes or no, if that’s all you need to say. You don’t need a sentence to say yes or no. You don’t need a word, and you don’t even need a letter. All you need is a bit, and by that I mean all you need is a zero or a one.

[00:03:24] Simon MacDonald: Thank you. Thank you so much for sharing that. It’s, it’s funny when, well, I, this is, and I don’t know if it’s funny or not, but I remember reading that passage in the book and being reminded of as a smaller child, my, my mom had a brain tumor, and friends came and tied a yellow ribbon around the tree just outside of our house so that when she, she came home from her surgery, she would see that.

[00:03:47] And yeah, just, just kind of reminded me of that. So it’s, wow. That’s, that’s so nice. Yeah. Yeah. It’s so, it’s a. You know, sorry, I’m getting a little, just remembering everything. But, but yeah, it’s a, it’s a really, really good feeling to see so much love for, for her. But obviously this is more related to computers and, and our zeros and ones But I’m gonna get things kicked off by asking you the first question, and as I reread the book in the second edition one of the things that I definitely wanted to ask you is, did you set out to write a timeless book?

[00:04:22] Like one where the information is going to be useful, 10, 20, 30, 50 years down the line? In most cases when I’m reading a book about technology, the information is pretty ephemeral. It’s gonna go out of style pretty soon, or the API is gonna change, or maybe the operating system or the company doesn’t exist anymore.

[00:04:41] But I feel like this is a book that I can hand to somebody in 10 years, and the information and the, the wisdom that’s in it is just gonna be as applicable today as it is then. It

[00:04:52] Charles Petzold: was a very deliberate decision. To try to make the book as, as universal and as eternal as possible. By the time I wrote this, I had my book Programming Windows.

[00:05:04] My first book had already been through five additions going through Windows 2.0, 3.0, 3.1, windows 95, windows 98. And I just, I just wanted something that would have a longer shelf life than that. And so that was part of my incentive for looking at ancient technologies and particularly when picking out a, a representative CPU, picking out the Intel 80 80, which even when I wrote the first edition was 25 years old.

[00:05:38] So, so, but the other reason for using ancient technologies is that they’re much easier to understand. But coming up with a, a book that would last forever was certainly, or at least, you know, 20 years was certainly a primary

[00:05:52] Simon MacDonald: motivation. Well, I would say mission accomplished. There’s not too many books I can pull off of that bookshelf or that bookshelf or the 20 or so that are stacked on the floor next to me that you could say exactly the same thing about.

[00:06:07] Kind of, oh, sorry. Before I forget folks, just I’m gonna ask way too many questions if you let me, so please jump in with questions. And Charles had mentioned before some of you joined, it doesn’t specifically have to be about code, it could be about his other books or just a general question about technology.

[00:06:24] Charles Petzold: We’re just having a conversation here. No technical windows or OS/2 questions, please. Or even WPF or Windows forums. Now it’s, it’s been a while.

[00:06:31] Simon MacDonald: Oh man. OS/2. I haven’t thought of it that in a very long time. Yeah. Okay. I mean, well that’s a, I mean, So when OS/2 came out, that was the Okay.

[00:06:44] IBM’s kind of answer to Windows at that point in time. If I’m getting any of this wrong, let me know. But also it was like Microsoft and IBM were kind of having their own bit of a cold war. And didn’t certain engineers switch from one project to the other in order to make Windows NT or Yeah, the,

[00:07:00] Charles Petzold: Yeah.

[00:07:02] At that point Microsoft and Windows were kind of collaborating on OS/2. OS/2 was designed to, cuz m because IBM was working on it independently, and then they, they decided that maybe if Microsoft and IBM got together, they could create this, this one operating system. And Microsoft wasn’t real happy about it, but they were kind of forced to go along with IBM for at least a little while.

[00:07:28] So yeah, I mean, OS/2 was a joint project. Although it mostly came out of IBM and Microsoft kind of didn’t have too much to say about it at that point.

[00:07:42] Simon MacDonald: Yeah, I don’t want to, I mean, I don’t wanna slander Microsoft, but it, it, it did seem, at least in, you know, in the, the nineties, there a lot of times where they would embrace, extend extinguish.

[00:07:53] You know, they kind of, you know, oh, we’re gonna learn as much as we possibly can by working with this other company, and then we’re just gonna make our own version of things. And that is my own that’s my own opinion because I did work with a company in the early two thousands where we demoed this wonderful telecommunications tool that we had to Microsoft, and six months later they had their own version of it.

[00:08:13] So that was, that was fun. . But yeah when you were talking about some of these like ancient technologies, I again, right at the very beginning of the book, you talk about a couple of you know, kids who are using flashlights in order to communicate back and forth with each other. And I remember doing that as a kid, you know, sometimes it was flashlights, sometimes it was like a, a can with, you know, two cans with a string tied between it in order to kind of, you know, sneakily communicate with your, your next door neighbor or your cousin, or whomever.

[00:08:43] But do you, and this is more of like me being a cranky old man. Do you, do you feel like kids are kind of missing some of this these days? I mean, I have a niece and nephew, they’re, you know, four and eight and, you know, they get handed these amazing devices, these iPad’s, you know, iPhones, these, which are great.

[00:09:02] I think kids should definitely have that. But they don’t seem to ever learn some of the, you know, I don’t wanna say hardships, but some of the more basic ways of, of communicating to see like how we build up from, from flashlights and Morse code up to an iPad.

[00:09:15] Charles Petzold: Yeah, I wish, I wish they were. more inclined to expose themselves to that kind of thing.

[00:09:23] Yeah, it’s a little unfortunate that there’s no real incentive to do that. There is, however, a considerable retro computing movement going on, so that gives me some hope that people will discover some of the roots of, of, of this industry and this, these technologies.

[00:09:46] Simon MacDonald: Yeah. Dan, I saw that you went on video. I just was wondering if you’re gonna ask a question before I jumped in?

[00:09:51] Daniel Lauzon: Yeah, well, I was just gonna comment on that. I know that with my kids are getting a little older now, but I realized that early in their in their growing up, that not only did they have to be more deliberate because so many things are accessible, but I did found that this, this curious nature of kids.

[00:10:08] It does definitely still exist and they find pockets. So maybe my son is not tinkering with the clock radio in his room and trying to wire it all up, cuz that doesn’t exist anymore. But he does find a way to turn whatever video game, blog building thing into this insane place where he can spend hundreds of hours tinkering in that very same way.

[00:10:31] So I think sometimes you know, these things take different shapes and it does take a little more care to make sure that that space exists, that kids can be bored and kids can sort of have the time to just play. But I think that’s, that’s universal this, this idea that we can we can play to learn and build and, you know, make your own understanding of things.

[00:10:51] And yeah, but it is definitely harder. It is definitely harder when so many things are packaged up than not meant to be tinkered with for sure.

[00:10:59] Charles Petzold: As I, as I was working on those opening pages, I realized that most people these days used a flashlight on their phone rather than an actual flashlight that, that I was familiar with.

[00:11:10] So, and for people to use the flashlight on their phone to send Morris code, what seemed a little bit of a stretch to me. So , I stuck with the original. I stuck with the original.

[00:11:24] Daniel Lauzon: I did find personally that in reading the book, that this framing of the first story really put me in that mindset though.

[00:11:31] And that was very, because a lot of this stuff, if you’ve been around tech for a long time, is very familiar. Putting myself in that frame of mind when we were much more playful and young on our journey. The learning helped a lot to make me wanna recover these things sort of a, in a discover it again kind of way.

[00:11:51] It was, made the book super enjoyable. That was definitely a fantastic choice.

[00:11:55] Charles Petzold: Thank you. I have a question. When I first started, when I first wrote this book, I discovered that a lot of programmers, which wasn’t really my primary audience for the book, but a lot of programmers didn’t actually know how computers added numbers together.

[00:12:12] They didn’t actually know what the logic gates were doing. Is, is, is, do people have a better overall education these days so they know when they’re getting so the programmers know this stuff? Or is the book still revealing? Some secrets that, that are not commonly known among even among programmers.

[00:12:34] Jonathan Lipps: Well hi Charles, I’m Jonathan. Hi just, just found out about this event and the second edition of your book today via Twitter. May rest the piece. So a little bit, a little bit behind here, but I read the first edition about, I don’t know, eight, eight years ago maybe. And I’m a, you know, professional software developer.

[00:12:52] And I didn’t have a Computer Science degree although I did go through like the equivalent of the kind of the first year of first one to two years of a Computer Science at university. And so speaking from my experience, there were a number of elements of your book that were eyeopening to me where my, I knew that something like that must have been the case , right?

[00:13:15] Because, you know that. You know, you know what binary means, you know, that you could encode anything in binary somehow, but the physics of it were hand-wavy. Right. We were never taught I think, I think I wasn’t even taught specifically that that there’s not like a, an actual binary voltage. Like it’s more of a, a continuum and then a certain arbitrary point if it are to one or a zero.

[00:13:41] Like those kinds of details were not, not in my mind at all. Mm-hmm. . But I think I’m imagining it may have even gotten worse because of the high level that people are, are taught to produce work at these days. Right. So for me, even like the part that was most mind-blowing was. When you, you get to the point that, you know, cuz your whole book is like building up, right?

[00:14:02] You get to the point where you can see how code really is just data. And, and I was like, oh, right, because like as a programmer you’re used to doing things with code and it kind of has this magic ontology to it, right? Like code is special, code is the stuff that we use to make things happen. So I was like, Nope.

[00:14:23] It’s all just data with conventions. Right. And we’ve defined, you know, certain bits of data to mean, do certain things. That was a really cool, like, mind-expanding sort of experience that like, again, you know, you assume has to be the case somehow, but you’re not directly at least I wasn’t directly taught that.

[00:14:43] Charles Petzold: So one, one of the things that was personally eye-opening to me was when I started working with, with 8080 assembly language and machine code. And I was, I was building an electronic music synthesizer that was controlled by a, a, actually a Zilog Z 80 processor. And you look at the, the, the program set and machine code, and there are all these patterns in it.

[00:15:07] Like all, all the, all the things that, all the codes, all the instructions that, that reference registers refer to the registers with three bits. And so you realize, oh, this is, this is a machine code, but these, these bits are actually signals that are controlling hardware. So it, it’s the complete merge of software and hardware.

[00:15:29] And that was kind of the theme that I wanted to get across one of the big themes I wanted to get across in the, in the book. Yeah.

[00:15:37] Jonathan Lipps: I’m, I’m curious as a kind of, you know, cuz I had my experience with it, but I’m curious what other people have told you as feedback throughout the years? Like what have their, like.

[00:15:47] mind, mind-expanding moments been,

[00:15:51] Charles Petzold: I think just, yeah, I think just the idea of how hardware can carry out, how Logic Gates can carry out Arithmetic operations. I think that’s one of the big ones. If you can go through your entire program career and not really know how numbers are added inside the computer and it’s, it, it comes out, it’s fairly simple.

[00:16:15] It’s fairly simple and straightforward, but I’ve, I had a couple of ideal readers in mind when I first wrote it. Many of the other programmers I knew at the time we had a common complaint that our parents didn’t know what we did for a living. So in one sense, I was gonna, trying to write it for those parents.

[00:16:34] This is what computers are all about. I thought when I was working on the first edition, that maybe politicians would read it so they would know what the hell they’re talking about when they address digital technologies. It turns out that a lot of just regular programmers were fans of the book because it revealed parts of their industry to them, or parts of, of the technology that they didn’t really grasp.

[00:17:01] I also have heard from a number of high school teachers who have like a, a special class for people who are kids who are interested in computers, where they use the book in the class. And that’s, that’s kind of cool too.

[00:17:16] Simon MacDonald: Yeah. From, from my own experience, my degree was in computer science. It was a little bit computer engineering.

[00:17:22] It was a little bit of electrical engineering. It was, it was. You know, it was not super well defined in, in the late nineties at my university. But we learned a lot about logic gates and how computers are put together. So that part was like a refresher for me. But what I really loved about it is how you start from the very beginning of like how all the stuff works and then you build up a little bit at a time using analogies that I can then take to other people and explain to them how computers work.

[00:17:51] Cuz same thing with my dad. Like he is, he is a very smart man, but he is not computer literate. So I have not been able to explain to him for 25 years what I do for a living, but yeah, that’s okay. He’s like, as long as you’re employed, I don’t need to know. But the other, the other thing is I do talk to kids a lot, like high school students, junior high school students, about what it’s like to be a programmer.

[00:18:13] And sometimes it’s really hard to explain because it’s like, it kind of seems like magic to them. But being able to lean on some of the metaphors that you have in the book is like super useful for me personally because I just want kids to know that, you know, the computers, they’re not smart.

[00:18:28] They’re really dumb. They can just, they just can add really fast and that’s all they really do. But then you can learn all the tricks on how to make that adding really fast into webpages or video games or whatever you want to build. And so it’s, it’s been very useful to me. So I I appreciate that.

[00:18:46] Charles Petzold: I have a friend who is working with kids in robotics and that seems to be one area where you can really get kids interested in, in, in doing some low level coding.

[00:19:00] Ryan Bethel: Yeah, I mean, that was my experience growing up. I became an electrical engineer. ,

[00:19:06] Simon MacDonald: but, and

[00:19:07] Ryan Bethel: Initially I didn’t really, I wasn’t too interested in, in writing code or, or software as I pictured that because I wanted to be hands-on and build things and so only later did I realize,

[00:19:23] Simon MacDonald: so I worked as an electrical engineer and I learned all the low level

[00:19:26] Ryan Bethel: things.

[00:19:27] Simon MacDonald: And just later realized that,

[00:19:29] Ryan Bethel: you know, if you take that abstraction up to the higher level languages, you can, you’re still, it’s actually feels more hands-on to be able to get immediate feedback in the code you write instead of in engineering, you may work for six or eight months building a , a chip, only to never actually even have that in your hands to play with, but,

[00:19:58] Charles Petzold: I what? I went to what I believed to be the first college in the country that required all freshmen to take a programming course. This was an engineering and science school called Stevens Institute of Technology in, in Hoboken, New Jersey. And so I had a for course freshman year of college and it, but we had punch cards and a PDP 10 and you’d submit your punch cards to the guru behind a desk who would flip through and say, oh, I see some syntax errors in here, blah blah through running through the machine, and they get your printouts an hour later.

[00:20:31] And I just hated it. And I did have an assembly language course in college. The ins, the book that we used was written by the instructor. The book was called Meet Macro 10. It was assembly language for the PDP 10. And this made no sense to me whatsoever. And I think it was, looking back, I think it was, nobody actually explained about how the assembly language corresponds to the machine codes that are actually running the computer internally.

[00:21:00] So I left college with not a big not a big fan of programming and I never thought I’d, I’d get into it. But the way I one, oh, I got into it at work cuz I worked for an insurance company. But another way I got into it was that I was started making electronic music instruments at home. And I started off with, with a lot of digital logic running little sequences that were stored in, in, in memory.

[00:21:23] And at one point I thought, why don’t I. If I could store some codes in memory that would make the hardware do something a little different I realized I was reinventing the microprocessor. So it was it allowed me that revelation allowed me to actually use a microprocessor for the electronic music instruments that I was building.

[00:21:44] And I tried to, I tried to convey that kind of idea in the book where you get to this point where you’re, you can build a circuit that adds numbers together, but if you put a little codes in there, you can make it do addition and subtraction and maybe something else as well.

[00:22:00] Simon MacDonald: It’s funny that you should talk about music because I’m, I, by my count, I think at least two of the people in this call today, besides yourself are musicians.

[00:22:08] So it’s amazing the overlap of programmers and musicians. I think one of the one of the most talented programmers I’ve ever worked with he never took a university course in his life. He was a musician and then just decided that he would teach himself programming one day, and now he’s like a principal scientist at a large company.

[00:22:28] So, sure, why not?

[00:22:29] Anybody wanna jump in with a question?

[00:22:35] All right, well, I’m gonna do a, oh, sorry. I got one more,

[00:22:38] Jonathan Lipps: Simon. Yeah, go for, because, because I didn’t actually, you know, participate in reading the second edition yet. Although I would like to get my hands on it because I just borrowed the first edition. Charles, what, what is the, any significant differences or what were you excited about in bringing to the

[00:22:53] Charles Petzold: second dishing?

[00:22:54] Yeah, they were two, there were things that were dated in the, in the first edition that I knew I wanted to fix. One of them was in a chapter. Bits in common life. I had, like, I discussed a UPC code, but I also discussed the boxes, little squares on rolls of 35 millimeter film that told the camera what the ASA rating was.

[00:23:16] And I thought nobody has seen a roll of 35 millimeter film for years. I took that out, but I added a stuff on the QR code. There’s a big section of, of dissecting a QR code up until the error correction, which. Beyond the scope of the book. Unicode in the first edition was like one paragraph near the end of character in coding, and I really needed to expand on that.

[00:23:41] I consider Unicode one of the most important developments standards in computing, particularly for emojis. You know, if we didn’t have, we, we wouldn’t have, we wouldn’t have a whole bunch of emojis that you could send on an Android phone and get it read on, on an iPhone. So, and right when I was doing, when I was working on that chapter on Unicode, I got an email from the ISP who, who hosts my not the ISP.

[00:24:09] The, my web, the, the company that hosts my website, and there was an apostrophe in the subject line of the email that had been turned into three different, separate characters. And I thought, oh, this is so common. Everybody has seen this. This is, and it’s a mystery to people why this happens. So I realized I would have to discuss the Unicode transformation formats and, and UTF eight and how that works and how apostrophe has turned into three separate characters.

[00:24:40] So that was important. So there was some little updating of those things that had actually had gone stale in the first edition. But what really, bothered me in the first edit. was, I had a chapter called Automation, I think that showed what I was just describing. This circuit that adds numbers together, and then another circuit that where you can put codes into memory and it adds and subtracts numbers.

[00:25:08] And from there I made too big of a leap. I made a leap into first the history of computing in one chapter and then discussing two classic microprocessors of the 1970s. And I thought that that leap was too big from, from simple codes that. Told hardware how to add and subtract to microprocessors that are working on a, a, an instruction set of 256 codes.

[00:25:38] So I put in additional chapters that really built the CPU. And I, the circuitry that I show in the book and which I implement on the website I haven’t finished a website. Website is, is code hidden language.com, and it has interactive graphics of, of a lot of the circuits. So I, I build an arithmetic logic unit.

[00:26:03] I build a register array. I show how control signals are generated by machine codes that control these things and then move stuff from memory into the register array, and then from the register array into the arithmetic logic unit and back again. So It goes, the fitness book goes much deeper into how an actual computer works.

[00:26:24] Or at least how the Intel 80 80 , how a subset of the Intel 80. 80 works. And that was That’s great. That was the, that was the biggest job I had once I made that commitment that was hard.

[00:26:38] Jonathan Lipps: Well, yeah, I’m, I’m excited to read those extra chapters. Cause I do remember it might have been that point where I was like, all right, up until, up until now, I haven’t had to take anything on faith.

[00:26:49] You know, I’ve been able to like, you know, do, do, you know, do my own work and be like, yep, yep, yep. That checks out. And then at some point it was kind of like, alright, I know that this is a direct extrapolation, but it’s too much work in my head now to like, go from here to like, I don’t know, a graphics processor or whatever.

[00:27:08] So I’ll just take it on faith. But I like that the theme of the book was kind of like, no, no step left out, right? Like, it’s just super incremental. So I think that’ll be a fun improvement to see

[00:27:19] Charles Petzold: at, at some point. I wanted to when I was, when I was working on the first edition, I always wanted it to be a 300 page book.

[00:27:25] Because I thought that would be more friendly to readers. And it turned out to be a 400 page book, which distressed me, and now it’s like 400 and it’s a lot more than that. It’s almost 500 pages. But I always thought maybe, maybe a, a shorter book that gets up until, up until how logic it add numbers together.

[00:27:43] Because that to me is, is one of the big milestones. And maybe, maybe people would be satisfied with that, that say, oh yes, and now I see and I can take the rest of faith, as you say,

[00:27:59] even for those of us who know you know, that this, this stuff is not magic, you know, that it’s just, it’s just bits controlling logic gates. It’s, it’s, some of what comes out is pretty, is pretty damn sophisticated. And it’s, it’s hard not to think of it as magic. ,

[00:28:17] Simon MacDonald: is it the O Mob quote? You know any,

[00:28:20] Charles Petzold: oh, I think it’s Arthur C Clark

[00:28:21] Simon MacDonald: Yeah, it’s Arthur C Clark. Any sufficiently advanced technology just appears as, as magic, and it’s like sometimes if you can, you know, look behind the curtain, you can, you can see the wizard who’s pulling all the strings and, and I think. In a lot of cases, that’s what you’ve done with the book is you’ve, you’ve made it very easy for people to understand like how computers work, even at a very low level.

[00:28:44] One thing I did want to call back to and what I mentioned earlier about, you know, kids not having, you know, the ability to mess around with low level stuff. And, and Dan eloquently put that, you know, they’re building these amazing things either in Roblox or Minecraft, so they’re expressing their creativity electronically.

[00:29:01] But we were talking about robotics briefly and how interested kids get with robotics. And I think a lot of that comes to the fact that they’re getting hands-on with the hardware and the software. So there, you know, besides, Making something virtually, you know, they’re not just pushing electrons around, they’re actually affecting the physical world, and they can experience that by like, seeing it and touching it.

[00:29:24] Charles Petzold: Sure. And let’s not, and let’s not, let’s not, you know, ignore them, the thrill of seeing your row, but destroy another row. But you know, that’s, I, the kids love that stuff,

[00:29:37] Simon MacDonald: Yeah, it’s always great when you, you know, you can put that little, you know, shovel thing and they just flip the other robot over top of you. Yeah. I, you know, I am at once sad that they didn’t have that when I was that age and also pretty happy because I have all of my fingers and toes right now.

[00:29:52] So, was I a clumsy kid? Yes. Am I a clumsy adult also? Yes. So

[00:29:59] Charles Petzold: yeah, Scott Hanselman and I had this discussion about whether people, new programmers really need to know the low level stuff and it’s, it’s, it’s a hard call back when, back when we were. We were all coding in c and c++. To me, knowing assembly language was vitally important because you could always tell whether a c programmer was familiar with assembly language or not as to how they, they used pointers to those of us who, who familiar with assembly language pointers were nothing we are using.

[00:30:34] We had been using pointers all the time, pointers to pointers and pointers to collections of pointers and stuff like that. But people who had not people who approached these, this just as a high level language pointers are fairly mysterious. But nowadays the, the languages people are using, mostly it’s, it’s really, it’s often very hard to use pointers.

[00:30:54] I know in C Sharp, my favorite language you can use pointers, but you have to, you know, mark your code as unsafe and stuff like that. So I don’t know if, if, if people really need to know this stuff or if it’s just, is it, is it too much background before they get to the real. Meat of the programming language that they’re gonna be using?

[00:31:18] I don’t know. I don’t know.

[00:31:21] Simon MacDonald: I mean, in, in my opinion, you, you don’t need to know this stuff, but it sure does help to know how all of, like, it’s, sometimes it is good to know how the sausage is made and you can learn how to do a task and, you know, be a wonderful programmer and not understand things at this deep level.

[00:31:38] But it certainly, it does help for a lot of things to understand how the sausage is made, really. And Ryan, I’m sorry, I think I cut you off there.

[00:31:48] Ryan Bethel: No, I mean, I think, I think my conclusion is that it’s helpful to know, but it’s, I think it’s a mistake to front-load, to basically say to somebody new, you need to start way down here at the bottom.

[00:32:02] Because when, I think

[00:32:04] Simon MacDonald: when it’s helpful to understand the lower levels of

[00:32:07] Ryan Bethel: abstraction is when you hit the edge cases where, where things fall apart at the higher level. Language, like when you’re pushing the speed of, of something and things, you can’t assume that things are operate as ideal components all the way down.

[00:32:25] I know that even when I was an electrical engineer and even on the same project, you know, I for a time was like an analog designer, so I would be working on circuits that were, you know, five to 10 transistors. Like a very small thing. But it was, it was designed to optimize some, some specific aspect and write, you know, two cubicles down with somebody working on a digital circuit that was thousands or tens of thousands of gates.

[00:32:57] And so like even. You know, at, at any one time, you kind of have to, you can only really think about in depth a certain number of those levels. And you can move back and forth, but I don’t think at, I don’t think it’s useful to

[00:33:12] Simon MacDonald: or

[00:33:13] Ryan Bethel: possible at any one moment to just keep the whole entire spectrum equally present in mind.

[00:33:20] Charles Petzold: Yeah. At one point when I was working on the website, when I first started working on the website that accompanies this book I wanted to have like a, a, a CPU. On the screen where you could keep zooming in, zooming in until you got down to the logic gates and then zooming in even further to get into the, the transit.

[00:33:41] It was, it was it was too ambitious that project to do that. And once you’re, once you get real focused into the, what does it tell you about the big thing? I don’t So I didn’t do it that way,

[00:33:57] I

[00:33:57] Daniel Lauzon: think, I think for me, the, the, this sort of revealing that you can actually understand the park and I agree with what It was Greg was just speaking sad that you effectively cannot hold all of this even when you spent your whole life and enjoy learning the details of things. You can’t really hold at all in your head, but I.

[00:34:19] Lesson that you do learn over time is that every time someone helps you, you know, reveal some aspect, you get more and more confident that these things that look like magic when they’re delved into can be understood. And that gives you a great confidence that, and it’s certainly where I feel I am today, where it’s like, I have an idea what it is, and if I have to, I can go into it.

[00:34:44] You know, and this is some of the magic of what we’re living with this open source world where you can, you know, don’t need a lot of encouragement to say, well, why don’t you open up the package? Or Why don’t you go look at the repo? And it’s, it’s possible to do, but I think that has to be trained into you by a few experiences.

[00:35:01] You know, it’s like when people have, like, when people have never traveled and they travel once and they’re uncomfortable and then they do it again. They’re like, oh my God, this is so beneficial to my life. I, you know, I should be more willing to go, to go there and uncover the parts. I was curious, I didn’t get to the, to the end of the book yet.

[00:35:18] I’m just about halfway. But there are and so I don’t know how, how high up the, the chain you go, but do you think that there are other aspects of computing in the world today that, that need to be understood, that are even higher level than what you have addressed where it’s, you know, networking effects or game theory stuff and how, you know, how abuse on Twitter and algorithms on Facebook work is, are those the kinds of things that you wish someone else maybe would address in a book or things that you would like

[00:35:45] Charles Petzold: have done?

[00:35:46] Yeah. I, when people ask me over the years if there’d be a second edition of code, I would ask, what, what do you wanna see in it? And invariably the answer would be the internet. Which I was a little disturbed at that cuz I thought that the internet was beyond the scope of the book. And I really wish somebody would do, would be inspired by my book.

[00:36:09] To write a book on the internet. And I don’t know where that book would begin. I don’t wanna write it. Anybody else who want has this idea can write it. But yeah, a lot of the a lot of the more mysterious stuff, and I think machine learning is going to be a real challenge because as machine learning gets more sophisticated, even the programmers can’t really explain how a certain result is derived.

[00:36:36] And that to me is, is a little, it makes me nervous. And it’s partially because The other book that I wrote that I hope will have a long shelf life is called The Annotated Touring, which is a, takes touring’s original paper on Computability theory and, and annotates it line by line, sentence by sentence.

[00:36:59] And touring’s. Big result is that you are limited in the types of, of Digital logic that you can implement. And the big restriction is that you can’t write a program that can figure out if another program is working correctly. And that should really give us pause as we start putting software into everything, including cars.

[00:37:24] People have had mixed results with, with auto machine driving . It makes me nervous partially for. Because we don’t know if the software’s working correctly unless we test the hell out of it. And you’re testing it on roads with actual people. And also there are moral issues involved with, with the cars.

[00:37:44] Software has to make certain decisions. If, if it’s, if there are pedestrians and there’s choices to be pedestrians that might be hit and choice cars that might be hit and their choice to be made. The software in, in, in a car would have to basically solve a, a trolley problem, which is a serious problem in, in, in moral philosophy.

[00:38:06] So you really need to know. Then, the car may sacrifice people outside the car to save people inside the car. Do you want your car’s software to be doing that? Or should it just save the maximum number of people? Should it make decisions about old people, saving old people versus young people?

[00:38:25] This is something that really needs to be hashed out before we let our cars make the decisions for your,

[00:38:33] Simon MacDonald: For. , certainly. Yeah. And I, that’s one of the things that computer science engineering programs need is to have these humanities classes, whether they be in philosophy or they be on ethics. I think in some cases, this, these things are just completely skipped or they’re, you know, bypassed.

[00:38:52] But yeah, it’s, it’s a difficult, difficult problem to solve. And, and on the topic of self-driving cars today is the first snow here in Ottawa. The entire city is coated in, in snow and ice. And so I would love to have a self-driving car someday that I could trust, but I want it to be made in Finland, like I need it to, like, I need 98% of it’s driving to be above the Arctic Circle so that it, it knows what to do when all it sees is white.

[00:39:19] Cause every other car I’ve been in that has like some sort of AI assist program, it gets confused by the color white, which is yeah, not good. Not good at all.

[00:39:31] Jonathan Lipps: Yeah. I really like what you were saying, Charles, about the ethical problems too. And I think, I think to me that means it’s, it’s really important for somebody to start where you left off in your book and, and do the same thing with, with AI and machine learning.

[00:39:44] Because I mean, even, even in the topics your book touches on quote-unquote lay people are likely to impute agency to computations. Right. In a, in a way, which is physically correct. And so your book kind of again, by de demystifying it Yeah. Helps us see like, yeah. There’s, there’s nothing magical.

[00:40:07] This is just purely deterministic unless, you know, a cosmic ray flips a bit. I mean, there’s, you know, some low level of determinism, right? But it’s, it’s fundamentally a completely well understood system. And as we go up the scale we might lose more and more insight and we might have more of a, a merely a statistical understanding of what’s going on, but we’re not suddenly magically turning into something else that we should therefore entrust with our, our lives and our moral decisions.

[00:40:35] Right? But I think that, that because the complexity gets so large, people become more willing to impute agency in a way that I think is dangerous, especially ethical.

[00:40:49] Yeah, I’m not, I’m not gonna write that book, obviously ,

[00:40:52] Simon MacDonald: I’d love to read it. . Yeah, same. And speaking of like inspiring people to write other books and, and yeah, I would, I would love to see more on this. Our CEO, Brian Laura, unfortunately could not be here but he wanted to ask you if you have read Neil Stevenson’s books at all.

[00:41:11] Charles Petzold: You know I have a copy of unread copy of Snow Crash on my shelf. Right. No problem. I think I think I , do we all have unread copies of Snow Crash on our show? I,

[00:41:21] Simon MacDonald: I have the third copy of Snow Crash that I have bought because I’ve lent it to people and it never seems to come back that one. So it’s actually, there’s a little chain on it now. Okay. But ,

[00:41:31] Charles Petzold: I think I read a book of his on, on command line.

[00:41:34] Did he write a book

[00:41:35] Simon MacDonald: called? Yes, he did. That was his, that was a ti

[00:41:38] Charles Petzold: Oh, really? Yeah. Believe it was a

[00:41:39] Simon MacDonald: tiny, yeah. First, first published work I think was like before the command line. I think that’s what it was called. Something like that. Yeah. And then, but I

[00:41:48] Charles Petzold: don’t read, I don’t read much science fiction, I’m afraid.

[00:41:52] Simon MacDonald: Yeah, Brian was wondering because he’s thinks Stevenson was probably informed by your writing; he probably read code is what he was saying because it’s like some of the things that you see in Stevenson’s book. He seemed to be inspired by code and I was wondering if there was, he was wondering if there was any kind of cross-pollination going on there.

[00:42:09] I I’d be

[00:42:10] Charles Petzold: honored if, if he, if Stevenson learns stuff from code, I think

[00:42:15] Simon MacDonald: he has that,

[00:42:16] Charles Petzold: that would thrill me. Just, yeah. I remember reading, reading

[00:42:18] Jonathan Lipps: Cryptonomicon. Around the same time maybe, or like within a couple years of reading Cohen, I was like, oh, these have a similar energy .

[00:42:27] Simon MacDonald: Yeah, that, so I read way too many books and I’ve read most of Neil Stevenson’s works and my recommendation is Cryptonomicon is probably that one, or The Diamond Age are probably his best books.

[00:42:39] He’s a wonderful writer. He makes you think big thoughts, which is great. He’s terrible at sticking the landing and I will defend that until my dying breath. It’s just, he can’t seem to ever figure out a way to end a book. They just kind of abruptly end. But it’s, it’s fun and, you know, it’s slap provoking, so you, you get some enjoyment out of it.

[00:42:58] Okay. Yeah. Yeah. Any, anyone else wanna jump in with a question? So if not, I have another one. All right. I’ll let you, I’ll let you get in there. I forget what chapter it was, but at one point you were talking about Claude Shannon, who’s the father of Modern Information Theory, and I think that’s a really interesting gentleman that not a lot of people know about.

[00:43:20] When you were doing the research for your book, it was there a biography or some other information on, on Shannon? I don’t

[00:43:27] Charles Petzold: think I encountered let me, let me check something. My old website had a bibliography that I used for books that I consulted when I was writing the first edition. Let’s see, and see if anything’s on Shannon.

[00:43:50] All right. So I wrote Mathematical Theory of Communication, of course, which is the 19 49 19 48 paper which is the first pa first published occurrence of the word Bit, by the way. Symbolic analysis of relay and switching circuits. I had a big book called Collected Papers of Claude Shannon.

[00:44:10] A biography I don’t think there was no, there was not a biography available at that time. I believe there is now, though. I think I’ve seen something.

[00:44:22] Simon MacDonald: Well, I’m definitely gonna have to check that out. He’s an incredibly interesting character. Mm-hmm. , and we owe a lot of like modern computers to Shannon’s work in the late forties, early fifties.

[00:44:36] He had a pretty good string of, of hits there.

[00:44:39] Charles Petzold: Oh, here’s, here’s, here’s something a mind at play. How Claude Shannon invented the Information Age book published in 2018. Also the Magician and the Engineer, how George Bull and Claude Shannon created the Information Age. So there’s more stuff available now than there was when I was working on the first edition.

[00:44:59] I didn’t do much additional research for the second edition aside from exploring the Intel 80, 80 and more depth so I could create a subset of it. But a lot of the factual information, for the second edition, I was able to get from Wikipedia, which is one of my favorite websites. And which I, which I mentioned actually in the second edition of code towards the end in the, in chap, the so-called chapter on the internet at the very end of the book,

[00:45:34] Simon MacDonald: I speaking of Wikipedia, I saw a fairly scathing tweet the other day where it was like, you know, pay Wikipedia $8 a month for everything it does.

[00:45:42] Like, oh no, never. It’s like, you know, pay $8 a month for a blue check mark . And it was at that moment where I was like, yeah, I need to start paying Wikipedia. Yeah. It’s like you never, I never really think of it. And it’s like, it is a resource I use all the time. It definitely requires my support or it should have my support.

[00:46:02] And honestly, I’m not paying $8 for a blue check mark. I don’t care. Just like ban my tweets. It doesn’t matter. But the same

[00:46:07] Charles Petzold: thing at one point, Wikipedia got me on the monthly payment cuz it’s, it’s just. It’s, it’s something I use a lot.

[00:46:17] Simon MacDonald: Yeah. I never really thought about it in, in those terms.

[00:46:19] And then that tweet, I was like, oh, yeah, I, same thing with my library. I get so many books from the library every month and I’m like, why aren’t I sending them some money so that they can keep things going?

[00:46:30] Charles Petzold: So here’s, here’s two things about Wikipedia. One, there are no ads. No ads. You get most websites, the ads are just incessant popups, things.

[00:46:44] You can’t even scroll the page right without the ads coming up. And secondly, I can go on Wikipedia, I can look up anything, and then I can go to Facebook and what I looked up will not. Anywhere in Facebook. Whereas if I search for something on Amazon or just do a Google search and, you know, and two minutes later Facebook is telling me what I searched for.

[00:47:07] So it’s, it’s, and in order to do that, in order for Wikipedia to be independent like that, it does, it does need. . Yeah, I,

[00:47:17] Simon MacDonald: it’s a very valid point there. And just a pro tip as we start to roll into the holiday season for folks. Remember when you’re doing online shopping for your friends and family, especially those of you that live in the same household, definitely have an ad blocker, definitely uses VPN.

[00:47:34] Do whatever you can. Cuz if you’re looking at that, I don’t know. Like maybe a pair of sneakers for your kid. They’re gonna get ads all over the place that you were looking at these pair of sneakers. So they’re not gonna be surprised on Christmas day or whenever yeah, I hate, I hate that about the internet.

[00:47:52] It’s very, very disturbing. But, you know, they know everything we’re doing, so but yeah. Folks, this is your last opportunity to ask a question of Charles before we start to wrap things up. So let me just give you this, this option here to jump in.

[00:48:06] Jonathan Lipps: Yeah, I’ve, I’ve got one more. I haven’t, haven’t checked out your interactive examples that you mentioned yet.

[00:48:11] But one of the things that I thought about before when reading the book is how cool it would be for someone to create a, a series of like sandbox environments that, you know, help them not just to see the examples. You know, working fashion, but to create their own, you know, instances of these examples or maybe to go through a series of challenges like, like in a game sort of way to kind of really solidify the understanding at one level before going up.

[00:48:37] Cuz that’s, you know, one thing that I notice is if I didn’t really have a super solid grasp at one level and I then tried to go to the next chapter, I sometimes had to be like, oh, gotta go back and, and make sure I really understand this. And sometimes some of the interactivity could, could be helpful there.

[00:48:51] So I’m wondering if anyone’s just done.

[00:48:53] Charles Petzold: Yeah, I live you or, yeah, I thought about having a, a page where you could like drag logic gates together and wire them up, and I didn’t do that. I think there are some sites or apps that, that allow you to do that. Basically what this, the website is, is the illustrations in the book animated.

[00:49:14] So if, if, if, for ex example that the chapter on addition, it starts off with, with adding two bits together and then brings in a carry bit and, and then shows how eight of them can be cascaded to add an eight bit number. So it’s kind of cool, you know, you can punch in the binary two binary numbers and see how all the, the logic gates work and how it ripples, how it ripples through.

[00:49:41] And then I added and then next chapter, I think the book alludes to a look ahead carry logic, which is used to speed up addition. Instead of having the, the carry bit cascade from one stage to the other, you can have additional circuitry that figures out what that carry it’s gonna be. And so I implemented that just on four bits.

[00:50:03] I’m tempted to enlarge it to like 16 bits or something like that. But there’s, there, it’s just, it’s, it’s interactive illustrations. Cool. Check it out.

[00:50:15] Simon MacDonald: Thanks. I remember in university I was taking a compiler’s construction course and there was an 8 0 88 emulator that we were using. So we would basically write c code, we would run it through our compiler, it would produce machine code that would, then we would import into the 80 80 emulator.

[00:50:34] And if it got the correct result, it’s like we got a passing grade. So that was a, that was a really fun way of, of making sure, and you would see like the whole 8 0 80, it was emulated. You could see all of the gates like flipping and be like, yes, I added two numbers correctly. And it

[00:50:50] was,

[00:50:50] Charles Petzold: yes, if I ever, if I, when I, when I finish this website after I, after the book came out, the website was not quite complete and I kind of like drifted away from it for a while.

[00:51:00] I have to really get back and it finished the website. It will have a, a full. 80, 80 assembler of 80 80 chip, emulated, and assembler. But it won’t, it won’t do compile c code ,

[00:51:15] Simon MacDonald: but in my defense it was a subset of C code, thank goodness, cuz there’s a lot of edge cases there . Anyway I’m really looking forward to the website being updated with some of that information.

[00:51:25] But yeah. What, what else are you working on now as we, as we begin to wrap things up? Yeah. Well, I.

[00:51:31] Charles Petzold: As, as I was researching the first edition of Code, I got interested in what’s sometimes called the pre-history of computing, which is not quite the 1930s. So, and that’s where the annotated touring came from.

[00:51:44] I first looked at Touring’s paper when I was writing the first edition of Code and said, Somebody really needs to explain what’s going on in this paper. And that’s what I did. But I also got interested in analog computing and at some point I’m gonna do a book on analog computing. But I think my next book, I’m kind of really trying to gear up and get psyched and focused and, and maybe try to finish this book in two years.

[00:52:10] It will be about Charles Babbage and a weird little book that Charles Babbage wrote where he attempts to use his, his calculating engine and probability theory to prove that miracles can exist. This is kind of a peculiar application of math, but and it has a lot of history behind it and involves the philosopher David Hume and his famous essay on Miracles in which he said, miracles do not exist basically cuz there’s never enough.

[00:52:41] You can never trust a testimony well enough to establish the existence of a miracle. So the clash of these two and people have done some other applied bayesian probability theory to miracles and stuff like that. So I don’t know. If there is an audience for this book or not, but I need to write it because I will definitely, I can’t, I can’t get it outta my head.

[00:53:03] Simon MacDonald: Let me, let me know how to preorder this. Do you need to need money now? Like, just send us to your publisher. We were like, yeah, we’re we already ready to preorder this? That, that sounds amazing. And odd coincidence last week I was at a trivia contest and one of the answers was Charles Babbage. And I looked like a genius.

[00:53:21] I tell you, . We’re like, how did you know that? And I’m like it’s a miracle, Simon. It’s a miracle. We just proved it. Okay. I guess you don’t need to write the book now. He was, he

[00:53:32] Charles Petzold: was an odd guy and how he came with it up with this one-off. Thing because, because digital computers had to be reinvented, but it was a hundred years later.

[00:53:44] Yeah. The first working digital computers were the 1930s. He was back in the 1830s. Yeah.

[00:53:50] Simon MacDonald: So his, and then people are like, who, who is this guy? It’s like, oh, he had, he invented the computer a hundred years before the computer was invented. And they’re like, what? . .

[00:53:58] Charles Petzold: Yeah. Yeah. . Actually, ADA Lovelace is more famous than Charles Babbage at this

[00:54:04] Simon MacDonald: point cause she was the first programmer and there’s a programming language named after her.

[00:54:08] So, yeah, it’s pretty amazing. Anyway, let me just say that this has been a delightful conversation. I’m so happy that you were able to take some time out of your day to chat with all of us. I really enjoyed the book. Please let us know when your, your next book is ready to be preordered because I will slam that by button

[00:54:24] And for anybody who’s, you know, been following the Begin Book Club here, we’re gonna take December off because it’s a busy month. Well, we’ll see you in the new year and, you know, if you have any suggestions of who we should talk to next, you know, please let us know. So, oh,

[00:54:38] Charles Petzold: thanks a lot. Thanks so much.

[00:54:39] This has been a joy.

[00:54:41] Simon MacDonald: This is awesome. All right, thanks Charles. Thanks

[00:54:43] Daniel Lauzon: everyone. Thank you Charles. Thanks

[00:54:44] Simon MacDonald: for everything.

[00:54:46] Ryan Bethel: Yes, thank you very much.