
The Evolution of Clean Code and Software Legends with Uncle Bob Martin - JsJ_671
Welcome back to another episode of Top End Devs! This week, we're diving into a fascinating journey through the history of computing with none other than Uncle Bob Martin. Joining our host Charles Max Wood and panelists AJ O'Neil and Dan Shappir, Uncle Bob shares intriguing stories from his book "We Programmers," highlighting the pivotal figures and groundbreaking moments that have shaped the computer programming world.
Show Notes
Welcome back to another episode of Top End Devs! This week, we're diving into a fascinating journey through the history of computing with none other than Uncle Bob Martin. Joining our host Charles Max Wood and panelists AJ O'Neil and Dan Shappir, Uncle Bob shares intriguing stories from his book "We Programmers," highlighting the pivotal figures and groundbreaking moments that have shaped the computer programming world.
Whether it's the story of John Backus leading the Fortran project at IBM, the brilliance of John von Neumann, or the challenges faced by early programmers like Grace Hopper, Uncle Bob brings these historical giants into vibrant focus, unraveling the personal and professional hurdles they overcame. You'll also hear about the evolution from computers as mere calculating machines to the versatile systems we know today.
As always, our panelists add their perspectives, discussing everything from clean code principles, programming paradigms, to the quirks of different programming languages. So, sit back and prepare to be both entertained and enlightened by the rich tapestry of our industry's past and its implications for today's tech landscape. Let's dive in!
Transcript
Charles Max Wood [00:00:05]:
Hey. Welcome back to programmer story hour with uncle Bob or JavaScript Jabber, as as we call it every week. This week on our panel, we have AJ O'Neil.
AJ O'Neil [00:00:17]:
Yo. Yo. Yo. Coming at you live from the now with plywood paneling shed. Or, like instead of drywall, I got some plywood from a friend who is dumping it.
Charles Max Wood [00:00:29]:
Nice. We also have Dan Shapiro.
Dan Shappir [00:00:32]:
Hello from Tel Aviv.
Charles Max Wood [00:00:34]:
I'm Charles Max Wood from Top End Devs. And this week, we have a special guest. As I said before, we got uncle Bob here. So, Bob, welcome back.
Uncle Bob Martin [00:00:42]:
Thank you so much. Good to be back.
Charles Max Wood [00:00:45]:
So, I was I was gonna ask you what's new, but, I have to say, Pearson reached out to me about reviewing Clean Code, a new edition of Clean Code. So it looks like that's gonna be a thing.
Uncle Bob Martin [00:00:57]:
Yeah. I'm in the midst of, the final reviews of that now, so it should be going into production within another month. And then, you know, that that process takes about three or four months. So
Dan Shappir [00:01:09]:
Even cleaner code?
Uncle Bob Martin [00:01:10]:
End of the year. What's that?
Charles Max Wood [00:01:12]:
Even cleaner code? We can only pray.
Uncle Bob Martin [00:01:16]:
Clean code second edition. Now I tried to play with other titles, but the publisher was very adamant. Yeah.
AJ O'Neil [00:01:23]:
He didn't
Uncle Bob Martin [00:01:24]:
get clean codes second edition.
Charles Max Wood [00:01:26]:
I think it's easier to sell if you keep the title.
Uncle Bob Martin [00:01:28]:
It's You know? Yeah.
Dan Shappir [00:01:30]:
We're not supposed to that's not that's not the topic of our conversation, but I've got to ask. I mean, the clean code principles seem pretty kind of universal almost. So why do we need a second edition?
Uncle Bob Martin [00:01:44]:
Oh, heavens.
Charles Max Wood [00:01:49]:
I did say story hour. Go for it, Bob.
Uncle Bob Martin [00:01:53]:
For the longest time, I thought, you know, I'm done. I I don't I've never done a second edition of anything. Usually, when I write something, I think, okay. I said it. I don't need to say it again. And for the longest time, I thought that would be the case with clean code. But the clean code became so controversial. There were so many misinterpretations and misrepresentations and, you know, errors on my part where I said things that could be taken in the wrong way that I thought, you know, maybe it's time to dust that thing off and see if there isn't something I would say differently.
Uncle Bob Martin [00:02:31]:
And then as I was doing that, I thought, you know, there's all this new stuff. There's all this AI stuff. There's always, you know, Copilot and Grok and all that stuff. How does that play in? And and besides that, there's languages that I should probably explore, like Go. And and I thought, okay. Fine. Let's let's do a top to bottom rewrite incorporating some of the original chapters with a lot of, changes and just a whole new bunch of new chapters. The overall message is, of course, the same, but the way I say it and the examples that I pose and some of the the nuances have shifted a a rather significant amount.
Uncle Bob Martin [00:03:15]:
So I'm I'm happy with it. I also decided to add a whole bunch of other stuff like design principles and design patterns. It's kind of like, okay. Everything I've learned over the last ten years, let's kinda funnel it into this book and and see what happens. So that's why there is a second edition. Not least, of all of that is that my publisher said, you know, you should write a second edition. I thought, okay. Probably a good idea.
Dan Shappir [00:03:45]:
Awesome. You you mentioned the fact that you cover new program additional programming languages in your new in your the new edition.
Uncle Bob Martin [00:03:53]:
Yeah.
Dan Shappir [00:03:54]:
I'm curious in that context, How to what extent does the choice of the programming language impact the meaning, I guess, or the consequence of the code being clean? Like, would would you apply the same principles in for in order to achieve clean code in different programming languages?
Uncle Bob Martin [00:04:19]:
And and that is one of the points of the second edition, which is that the programming language doesn't matter much at all. I I'm gonna show you an example in Python. I'm gonna show you an example in Ruby. I'll do one in closure. I'll do one in Java, a two one in c. Doesn't seem to make an awful lot of difference. There are little quibbles that you can make. Some languages want the order of the functions inverted.
Uncle Bob Martin [00:04:48]:
You know, if you're working in Python or or if you're working in closure, they want low level things stated before high level things.
Dan Shappir [00:04:54]:
I hate that.
Uncle Bob Martin [00:04:55]:
Whereas in Java, you can turn it around in a way that makes more sense. But overall, the the the message of the book, applies to all of those languages. And and in the second edition, I tried to demonstrate that by just changing language from chapter to chapter to chapter.
Charles Max Wood [00:05:13]:
Yeah. I remember
Uncle Bob Martin [00:05:14]:
when With the help of Copilot, by the way, because I'm not a Python programmer. So I fire up Copilot, and I get a lot of help. It was it was, it was pretty interesting to watch these AIs, throw code at me that I could review and then think, you know, that's maybe not so bad or in more cases, like, I think I could do better.
Charles Max Wood [00:05:37]:
Very cool. We're looking forward to that coming out.
AJ O'Neil [00:05:40]:
One thing that I hear is, like, the number one criticism that I hear, and I I think this is not accurate, but I I wanna know. People say, oh, or you could do it uncle Bob style and only have three or four lines in a function. Is that is that true, or is that just, like, a misquote or a perversion of something you said? Like, I know that a lot of demo code examples to do apps, whatever. Yeah. Like, you end up you know, if you were gonna enterprise it and, yeah, then you're gonna end up with a bunch of things that are three or four lines long that don't do anything meaningful. But what what is your actual advice on function size or or grouping of logic?
Uncle Bob Martin [00:06:28]:
Actual my actual advice there is to keep it very small. I like small functions. And, you know, how small? Well, three, four, five, six, seven lines. Something in that range. I don't like to see 20 lines. I don't like to see 30. The the, controversy is, you know, two to three lines. Everybody says, oh, Bankabob says everything's gotta be two to three or or three to four or whatever number they they quote.
Uncle Bob Martin [00:06:59]:
And that's that's an example of people who did not read the book.
Dan Shappir [00:07:05]:
In that context, though
AJ O'Neil [00:07:06]:
That's what I figured.
Dan Shappir [00:07:07]:
That some some programming languages are more condensed than others.
Charles Max Wood [00:07:12]:
Yes. There are.
Dan Shappir [00:07:14]:
You know, you I know that you like closure. Closure is pretty dense.
Uncle Bob Martin [00:07:18]:
Very dense. So
Dan Shappir [00:07:20]:
three lines of closure could probably achieve a lot more than three lines of Java. Three lines of Java, two of the lines are open are open curlies and closed curlies.
Uncle Bob Martin [00:07:30]:
Yep.
Dan Shappir [00:07:31]:
So you're basically left with one line. That is Java.
Uncle Bob Martin [00:07:35]:
Certainly true. It is certainly true that that closure is much denser than Java, and yet it is much harder in closure to make small functions. And that's just because of the the functional style and the fact that you need to set a bunch of variables up front and then and then operate them at a lower place. And it's very hard to separate those things out as independent functions. So just just a quirk of the language, you end up with larger functions in closure even though those even though the language is denser.
AJ O'Neil [00:08:12]:
So do you have, like, a general rule of how to determine what belongs together. Because I think line limit to me to me personally, I don't think line limit makes a lot of sense because the line limit is arbitrary. Like, for me, I don't like to use comments. I put everything in a variable. So if I'm gonna do a mathematical operation where I'm gonna, you know, add days of the week and multiply by hours or whatever, I'll actually write that out line by line so that instead of commenting, this is taking this to make that because this number is special. I'll just var special number equals, you know, and and and that way that the variables declare themselves. So a function that somebody else would have that would be or or a operation. Like, I I break statements down.
AJ O'Neil [00:09:03]:
Right? So I don't I don't actually find line numbers in of themselves to be meaningful. Other than that, you gotta be able to see it on a page. Like, when you're looking at a block of code, generally, you should be able to see the whole block of code. If it extends beyond what you can easily see or you have to make your font size really small, then, you know, it's too much context in the brain.
Dan Shappir [00:09:23]:
I've got these. I don't make my font size too small.
AJ O'Neil [00:09:29]:
Yeah. But but on the other hand, and I and I think that there's the general case versus the exceptional case. This might be exceptional case. But if it's like a parser, I often find that my functions are way longer longer than I like them to be because it's like, well, one unit of logic for parsing this thing is just this much logic or transforming if it's like a parser or a transformer.
Uncle Bob Martin [00:09:57]:
Yeah. Yeah. So the line limit is always the wrong way to look at it. Right? It's just because it's not a line limit that you're really going for. And in the book and in the new book, especially, I I write a whole chapter about this in the new book. But in the old book, the rule was a function should do one thing. And how do you know that it's doing one thing? How do you remove the objective or the subjective, idea of what one thing is? And my answer to that is is that if you can use the extract method refactoring inside a function to pull another function out of it, you probably should. And then give that function a nice name, and those two functions will then do one thing.
Uncle Bob Martin [00:10:42]:
If you can take one function and split it in two with extract method, then you then that then probably you should, and those two functions will be smaller, of course. They'll both have nice names. That's that's my fundamental rule.
AJ O'Neil [00:10:57]:
If you don't know what to name your function, if your function name is do stuff, you definitely need to break your function down.
Dan Shappir [00:11:06]:
I literally once, had to, refactor code that had init one through init 10.
Uncle Bob Martin [00:11:14]:
Oh, jeez. Yeah. So But That's that's useful.
Charles Max Wood [00:11:20]:
But the the
AJ O'Neil [00:11:21]:
They kept the line rule.
Charles Max Wood [00:11:22]:
The thing that we're we're kind of circling around here, at least the way that I approach it is, I like everything at the same abstraction level for one.
Uncle Bob Martin [00:11:30]:
Yep.
Charles Max Wood [00:11:30]:
And so that's one rule that I follow. Right? And so if I can say this takes these steps a, b, c, d, e, f. Right? And I can, you know, I can name the steps. Then then that's usually what my function looks like, right, or my method or whatever. And then and then I have those somewhere else. Right? And so they and then those break down the same way. They're just the next layer of abstraction. But then the other thing is is that if, typically, if I have some big long function like, AJ's talking about with, like, a parser, usually, there are different stages or steps or functionalities in there that that I need to go through.
Charles Max Wood [00:12:04]:
And so I can break all that out too. And so in a lot of cases, I don't typically find very many cases in any language that I've written where I don't wind up with just some somewhat shorter method. The only time it gets particularly long is if you have a case statement, and I hate case statements because it it adds the line every other time. If if case case, then do this. Case, then do this. Case, then do this. Or if else if else if else if else if, which is also gross. But beyond that, yeah, typically, you can break it out into multiple
Dan Shappir [00:12:39]:
I prefer in direction over ifs and and clients switches. By the way, we have a question from the audience. Clojure, from Vinicius. I think I'm pronouncing his name correctly. I hope. Clojure developers value recursion more than any other. How does recursion impact clean code? Well, I think that Clojure developers don't have a choice except to use, recursion if they want to have to make, to create loops. You know, one of the people you didn't talk about in your book or a few people were, were church, and also I forget the name of the two guys that created Lisp.
Charles Max Wood [00:13:20]:
Oh, yeah. We're here to talk about we programmers
Uncle Bob Martin [00:13:22]:
and the history of programming.
Charles Max Wood [00:13:27]:
Go go ahead and answer this question, Bob, and then we'll move on and move on to story hour.
Uncle Bob Martin [00:13:32]:
Well, I mean I mean, Dan is right. If you're going to use a functional language, you have no choice but to use recursion. Recursion is a, the only way you can do loops in a in a functional language. How does it impact clean code? It doesn't. Good good expressive code can be expressed either with iterative loops or with recursion. So there's no real impact there at all. The the impact that closure brings to the rules of clean code is that, the act of creating intermediate variables is very difficult to extract out into other functions. Because enclosure, when you create an intermediate variable, it is in the scope of your function, and there's no way to get it out without doing some nasty trick like creating an atom or something.
Uncle Bob Martin [00:14:29]:
And okay. So probably don't wanna do that too often.
Dan Shappir [00:14:33]:
Because you don't want side effects.
Uncle Bob Martin [00:14:35]:
Alright. Right. Yeah. Yeah. I mean, you can manage those side effects by creating an atom and then making sure you don't overwrite the data that you stick in there. So in that sense, you probably could pull out those functions. And I've I've played with that technique a few times, but it's always ugly. So then I wind up with with functions that are 15 lines long, and I look at them and go, boy, I wish I could pull these things apart, but there's no real good way so far in closure that I have accepted.
Dan Shappir [00:15:08]:
Also, at the end of the day, it's not about achieving like you said, it's not, like, about achieving some magic number. It's Yeah. It's trying to make your I guess it would be try to make your functions as so as short as possible, but no but no shorter. Well Yep. Well Given
Uncle Bob Martin [00:15:25]:
the constraints of the language.
Charles Max Wood [00:15:26]:
And it it's it's not easy either. I think people kind of conflate length and complexity or length and difficulty and, you know, it it can and can't sometimes. But was it Mark Twain that said I didn't have time to write you a short letter, so I wrote you a long one?
Uncle Bob Martin [00:15:41]:
Who is Voltaire?
Charles Max Wood [00:15:43]:
It it was somebody important.
Uncle Bob Martin [00:15:45]:
But the
Charles Max Wood [00:15:45]:
point is is that it takes a lot of time to get right to to really get things at the in the right place so that you have something like that that's easy to put together in your head. Anyway, let let's get into we programmers. I think we did this last time when we were talking about your your other project where we went off on we programmers for about twenty minutes, and then it's like, no. We were here to talk about this other thing. So which is great because it makes it fun to talk to Bob. But, yeah. So I I'm kinda curious as we get in, what's your favorite part or story or whatever of the book, and can you kinda give us a little bit of the the story there?
Uncle Bob Martin [00:16:27]:
The fate my favorite story in there. Well, there's a lot of lot of stories that I really like, but my my favorite story in there might be the story of John Bachus. Because here's a guy, he who was a complete ne'er do well. He didn't have a great family life growing up, kinda dumped on school, didn't care about school because he's too damn smart. Right? And, you know, you everybody knows that kid who was so damn smart that that they didn't even it didn't even try. Right? School was just so damn boring. The hell with it. And, he got drafted towards the end of World War two.
Uncle Bob Martin [00:17:10]:
Fortunately, right at the right time, he got drafted. And and, the army saw this, you know, this ne'er do well kid and ran him through an aptitude test and it blew their socks off. And so they said, you need to become an engineer, and they put him into engineering school. Well, that was too boring for him. He did extremely well, of course, but it was too boring for him. And he he just spent his time at nightclubs and stuff like that. And, the army goes this right at the end of World War two. Right? So the army says, you know, this guy is so damn smart.
Uncle Bob Martin [00:17:46]:
They put him into medical school. He could become a doctor. And that was a bit more challenging, and Bacchus kind of enjoyed it, but kinda didn't. And then all of a sudden, the war was over, and, he had, he was out of the army, and he just dropped out of the school and said, yeah. The hell with that. And he he built himself a nice little Wi Fi system. Oh, by the way, that's not Wi Fi. Hi Fi back in the, you know, in the fifties.
Uncle Bob Martin [00:18:17]:
Nice sound system for his record player. Colin still owe me half of the people in the world know what I'm talking about. He built that, and he dabbled around a little bit. Really didn't get any jobs. And then a friend of his said, you know, you should see this really cool thing that's down, in one of the streets of New York City at the IBM Building. And he goes wandering over there, and he looks in the window. And and the at the IBM Building, Thomas J Watson, the guy who founded IBM, had put in the display window the world's second computer, big computer. Right? The the selective I can't remember the name of it.
Uncle Bob Martin [00:19:03]:
This gigantic machine, mostly electromechanical, couple of vacuum tubes, paper tape everywhere. This massive machine fills the room. It's got this really cool front panel. You know, Star Trek front panel. Lights are blinking. If you go inside, it's clicking away like crazy. And, Bacchus goes, oh, yeah. That's kinda cool.
Uncle Bob Martin [00:19:28]:
And he asks for a tour. And, the person giving him a tour, I think, must have smelled something. I mean, Bacchus was was in a very informal garb, shall we say. But must have smelled something about Bacchus' intelligence because the tour guide brought him up to the department head, and the department head gave him an aptitude test and hired him on the spot. And he became the project leader of the Fortran project that gave us the Fortran language way back in the fifties. That's that is one of the most interesting intellectual rags to intellectual riches stories in the book. He's a guy that you would never expect to do well at anything and winds up delivering this wonderful thing to the world at that time.
Dan Shappir [00:20:22]:
So I I have to ask. I mean, it's the book, I've not read it, but I've read excerpts. I've not read it yet. Let's put it this way. But I've read excerpts, and I also saw some of the stuff that you put out. And there are a huge there's a large number of amazing characters and crazy stories about them. How did you decide who to put in and leave out, and how did you get all the information about the ones that you decided to to put in?
Uncle Bob Martin [00:20:57]:
It's how did I decide who to who to who to leave in and who to leave out? This old Bob Seger song. Right? There were a few that were obvious that I had to put in. I had to put Babich in because the book wouldn't even start properly without Babich. And you have to put Grace Hopper, because she was kinda like the first. And if you're not talking about touring, you're not writing a a book about software history. So you gotta have touring. And if you bring in touring, you have to talk about, the math on Newman. Dave.
Dan Shappir [00:21:32]:
Hilbert?
Uncle Bob Martin [00:21:32]:
Hilbert. Thank you. I knew it was starting with an h. You have to talk about David Hilbert, and you have to talk about John von Neumann. So those were kind of obvious that's an obvious progression. And then, you know, why wouldn't you talk about the three authors of c? Why wouldn't you talk about Dennis Ritchie and and Ken Thompson and Brian Kernighan? You you you in fact, you you're gonna wanna end with that one because that's kind of where modern history begins.
Dan Shappir [00:22:03]:
Yeah.
Uncle Bob Martin [00:22:04]:
And then in the midst of all that, there are these milestones. And most of those milestones, I just uncovered by accident. Like, the the whole story of John Kemeny, the father of basic. What an interesting story that was. No. Everybody knows Basic. Hardly anybody knows the story. Thank you.
Dan Shappir [00:22:22]:
You're making an you're making an assumption that's based on our age.
Uncle Bob Martin [00:22:26]:
No. Okay.
Dan Shappir [00:22:27]:
I I I have to tell you that I speak with the developers that I work with these days. And, you know, sometimes the topic of the first what's your first programming language comes up, and I say basic, and they say what? Yeah. Like, people today don't be it. People today don't know about basic. I mean, you know, maybe they do because of Microsoft, you know, stuff like VBA. But other than that, they probably don't know what basic is. And you know what? That's not such a bad thing. Basic almost spoiled me as a programmer.
Uncle Bob Martin [00:23:05]:
Oh, well, you know. You didn't write COBOL then because that would have spoiled you as a programmer. Spoiled me as a programmer for a day or two.
Dan Shappir [00:23:15]:
Well, you know the story about Ellen Kaye and Grace Hopper?
Uncle Bob Martin [00:23:20]:
Please. Please tell me the story.
Dan Shappir [00:23:23]:
Well, I've I recall reading it somewhere that, he was walking around the university. I guess it would be Stanford, I think. I may be wrong. Maybe it was Berkeley. I I don't recall where he taught. But, anyway, he saw he sees a group of people, and he walks over, and it's because, Grace Hopper was there and they were, like, showing showing her around. And the story is that they introduced them and she they said, this is Grace Hopper. She, created COBOL.
Dan Shappir [00:23:57]:
And he said, oh, I'm sorry.
Uncle Bob Martin [00:24:04]:
Yeah. I am not kind to Cobol in my book. I'm very kind to Grace Hopper, because I think I think she was a remarkable person. But Oh, yeah. For sure. God, I hated Cobol. I I spent about three months writing COBOL when I was 19 years old. It was not a fun time for me.
Uncle Bob Martin [00:24:26]:
So I have I've walked away from that language and never looked back.
Dan Shappir [00:24:29]:
Remember what happened when, COVID hit?
Uncle Bob Martin [00:24:34]:
I I thought you were gonna go for, y two k. So, no, what happened when COVID hit?
Dan Shappir [00:24:39]:
I still remember. I think it was the, governor of New Jersey or something saying that our systems can't keep up, and we we're in dire need of cobalt programmers.
Uncle Bob Martin [00:24:55]:
Yeah. I've actually heard that since. There's a lot of people talking about, these things are all written in cobalt. No? Okay. Fine.
Charles Max Wood [00:25:06]:
Well, it's like any other project that I've worked on. We don't actually update it until it's breaking.
Uncle Bob Martin [00:25:14]:
I think I think some of these are long past that point.
Dan Shappir [00:25:17]:
Yeah. Well, look. Yeah. But they can
Charles Max Wood [00:25:20]:
they can patch it over and
Dan Shappir [00:25:22]:
yeah. Yeah. Well, she also invented the term bug as I recall.
Uncle Bob Martin [00:25:27]:
Yeah. Well, I don't know if that she invented it, but but in her notebook, there is a desiccated moth that she pulled out of the, the relays in the the Harvard mark one. And and in the notebook, it says, this is the bug we found in the machine. So I I believe the term actually came from telephony, maybe even fifty years before that, but she put it in a software notebook, so we can credit her with that. She was, however, responsible for creating the glossary of terms, one of the earliest glossary of terms in our in our industry. So she coined things like register and bit and break point and a bunch of other words like that that we all know and love today.
Dan Shappir [00:26:17]:
So, again, how did you go about the research?
Uncle Bob Martin [00:26:21]:
I have got, like, a zillion books. And so it's all secondary research. You know, I didn't do any primary research. In some sense, you could look at we programmers bring book out. We programmers. You can look at that book as a a literature review, because I I read really significant books about Babbage and and about Grace Hopper and about all these guys. Right? And then I tried to condense them down and pull out two things. I wanted to pull out the human side of the story so that programmers who read this could identify the character flaws that they see in themselves, and these people are replete with character flaws.
Uncle Bob Martin [00:27:08]:
And then I also wanted to pull out the deep technology. That's something that most of these books do not go into. So I had to do that research myself. So when they're talking about when when they're talking about the UNIVAC one, they don't really go into much detail. So I've gotta pull all that information out and then describe, okay, programmers, this is what a UNIVAC one was like. This is how you program that. I actually put some UNIVAC one code in there. And I I talk about the, the the kind of code that Grace Hopper had to write in the in the late forties and early fifties to get the Harvard mark one to works.
Uncle Bob Martin [00:27:48]:
I wanted the programmers who read this book not only to identify with the human side of these guys, but also to identify with the deep technical problems that they were solving. So there's this really interesting juxtaposition. I think it's interesting anyway. Interesting juxtaposition of these these frail human people dealing with really difficult technical problems. Do you
Charles Max Wood [00:28:14]:
I I'd like you to go into more depth on one of these. You know, you mentioned, like, maybe the the UNIVAC or something else where, you know, it's just something that we don't even fathom, but they had to just figure out.
Uncle Bob Martin [00:28:28]:
Well, I mean, start with, start with the Harvard mark one. This was a a machine that was built by, Harold Aiken Harold Aiken kind of conceived of it in the navy. He was a navy guy, sort of get some popcorn. He he talked to the navy into building the thing. He actually talked to IBM into building the thing and then didn't give them any credit for it, which was a real problem for him later on. But his idea was to create this calculator, that could add, subtract, subtract, multiply, and divide, numbers that had 23 digits. I think that was the numbers. These numbers had 23 digits decimal.
Uncle Bob Martin [00:29:07]:
No. No. This wasn't binary. And the the digits were all held in these counter registers. And the counter registers could be addressed and moved into arithmetic units that could add I think it could add, three numbers per second if I remember correctly. And it could multiply and it and it could multiply in something under ten seconds. So fast by the day fast by the standards of the day, but impossibly slow from our point of view. This machine was programmed by punching holes in a 24 channel paper tape.
Uncle Bob Martin [00:29:50]:
And the 24 channels were broken up into eight zones, and the zones were, the register you wanna take the data from, the register you're going to to put the data in, and the operation you're going to perform on it. And those eight channels were all binary, sort of, sort of binary. The programmers programmed this by identifying what holes should have to be punched in that paper tape, and they did that numerically. So they would write their code as, four three six. I think I got that right. And four meant punch the fourth hole in zone one, punch the three hole in zone two, punch the six hole in zone three. That's how they would write their code. And if more than one hole had to be punched, they would write two two numbers in that zone area.
Uncle Bob Martin [00:30:50]:
Then they would come up with this program that was line by line by line, just these numbers, these three component numbers. And Grace Hopper is looking at this. She was like the third programmer in there and was was immediately turned into the the elite. She took over the whole thing. Had never seen a computer before in her life, had no idea what these machines were. Aiken threw her into the task and said, okay. For your first job, you have to compute the the arctangent coefficients to 23 decimal places. The interpolation coefficients for doing arctangents, in, 23 decimal places, which took her a week.
Uncle Bob Martin [00:31:30]:
And she had to figure out how the machine worked and how to punch the holes. And and, of course, she couldn't she didn't have dedicated time on the machine, so she had to steal the time, when the other guys weren't as busy as they usually are. And she managed to get that all done, and she worked all this out. And she realized and by the way, this is where the word code came from because they were writing codes. It was these numbers. So they called it codes, the computer codes. And she was one of the first person's people to say, well, each line ought to have a comment on it. So on the coding sheets that they had produced, you know, mim me a graph machine and they would, you know, crank out and produce these coding sheets, She put in a column for comments.
Uncle Bob Martin [00:32:15]:
First person to ever do anything like that. They, they began to learn as they were writing the programs for this thing. And the the kinds of programs they were writing were ballistic trajectories for artillery shells and, the timings of tides in various places, very deep mathematical problems. And as they did one after the next after the next, they started realizing that they were writing some of the same codes over and over again. And so they would take these little snippets that would do something, some task, some small mathematical task, and they would write them into their notebooks. And they called these transcriptions in their notebooks, subroutines. That was their name for them. And then they would share this back and forth.
Uncle Bob Martin [00:33:08]:
They would share their notebooks back and forth and eventually created a library of subroutines, which were just these handwritten documents in in a notebook style. And whenever they wanted to use one, they would go to the notebook, they'd look it up, and then they would transcribe manually those codes into their program. Of course, the register numbers had to change because one in one case, you might be using register three. In another case, you might be using register eight. And so when they wrote these in their book, they they used the convention that all registers were zero or based on zero, so they invented relocatable programming just out of sheer raw need. Eventually, the programmers would write the numbers, but they would hire people to do the punching. And then the the tape, the long tape, and these tapes got pretty long, the long tape would go back to the programmers, and the programmers would verify the holes against the code that they had written. There was no jump instruction.
Uncle Bob Martin [00:34:26]:
There was no way to do a loop unless you put the ends of the tape together, and then you could have a loop, and they actually did do that. I'm not sure that's where the word loop came from, but they did make loops of tape. But usually what happened was that there there was a halt instruction. There was an instruction that would stop the machine. And then on the tape itself, tape was fairly wide, 24 channels. Right? So on the tape itself, they would write instructions to the operator. If register three is less than 28, then go to and there would be a mark on the tape where they would back the tape up to and run it again. So all of the loops, all of the transfers of control were manual.
Uncle Bob Martin [00:35:11]:
They were they couldn't be done automatically, which means that the operators were always on call, always watching the machine, always repositioning the tape to try and get any kind of iterative process done correctly. That's just a glimpse of the horrors of the earliest of programming jobs.
Dan Shappir [00:35:35]:
One of my favorite characters that you also talk about, and I actually learned about him from, reading the book about the Manhattan Project when I was a kid, is John John von Neumann, who was an amazing intellect and person. His cape like, you you know, you watch a TV series like The Big Bag Theory, and everybody's kind of amazed by the capabilities of the Sheldon character. Well, think about somebody like that only doubled, but also highly social. Yes. He he was well known for his parties.
Uncle Bob Martin [00:36:13]:
Oh, yeah.
Dan Shappir [00:36:14]:
So there's so, for example, there's this famous story about him. He basically had, what a photo well, you don't say photographic memory. How do you call it these days?
Uncle Bob Martin [00:36:26]:
Photographic. Eudetic. You know?
Dan Shappir [00:36:28]:
Eudetic. Anyway, so a friend of, a friend of his, you know, tells a story where, you know, he he claimed to have this amazing memory. So to test him out, he asked him to recite the chapters of, Between Two Cities, which he read, like, when he was a youth. And he basically started reciting it, and he asked him to stop after something like ten or fifteen minutes.
Uncle Bob Martin [00:37:01]:
Yeah. That I I have seen that story, reproduced a few times in in slightly different context. But I think it's really clear that John von Neumann may have been the smartest person ever to have been born. And easily comparable to somebody like Einstein or, James Clerk Maxwell or someone like that. He he had this uncanny ability to switch disciplines and still be an expert. So he he was deeply involved with quantum mechanics in the early days. He was deeply involved with the the Manhattan Project. He was the only person on the Manhattan Project who was allowed to leave and come back and leave and come back at will.
Uncle Bob Martin [00:37:48]:
He could go anywhere he he needed to go because all the other parts of the military needed his advice. He was deeply involved with ballistics. He was deeply involved with with the shock waves of of explosions. He was he was running the computers at Manhattan on on the Manhattan project. He went out and looked at other ways of doing the computations. Didn't find a good one. Still stuck with the IBM punch card approach, but but, managed to get the initial, the initial models of the implosion of the of the plutonium core to work. The guy was, just a remarkable guy and and lucky as hell until the end of his life.
Uncle Bob Martin [00:38:32]:
Lucky as hell. Because he he managed to leave Germany A Year before it became impossible to leave Germany. He, joined the the Princeton Institute. Right? He was the guy who brought a lot of other guys over from Germany saying, hey. You know, it's nice over here in The US. You could come to Princeton. Oh, Einstein, come on over here. You know? People like that.
Uncle Bob Martin [00:38:53]:
So he was a massive recruiter. And like you said, it's it's unusual to find a guy who is supreme intellect, who has supreme intellect, and yet really good social skills. And he did. He was a social animal. So very Kind of like Feynman. Like Feynman. Yes. A lot like Feynman.
Dan Shappir [00:39:19]:
The funny thing about him, you talked about how some of these characters were kind of flawed, was that while he was such a great, amazing person and made so many contributions, he was also wrecked with self doubt. And he was, like, he felt that he did not he that he hadn't achieved as much as as his colleagues.
Uncle Bob Martin [00:39:41]:
What's the name of that syndrome? There's a it's that's got a name. I can't remember what the name of it is.
Charles Max Wood [00:39:45]:
Imposter syndrome?
Uncle Bob Martin [00:39:47]:
Kind of the other way around. Right? It's like,
Dan Shappir [00:39:53]:
he basically
Uncle Bob Martin [00:39:54]:
thought you've done enough. Right?
Dan Shappir [00:39:55]:
Yeah. He thought that he would, like you know, every obviously, everybody knew what Einstein would be remembered for and every and they knew what Hilbert would be remembered for, and he thought that he would not be remembered.
Uncle Bob Martin [00:40:07]:
Well, he was remembered and fondly.
Dan Shappir [00:40:11]:
Yeah.
Uncle Bob Martin [00:40:12]:
He was one of the inventors of Monte Carlo, the Monte Carlo method. And the story there is fascinating. They were trying to figure out, you know, how how to model, the the, diffusion of neutrons through a plutonium core. Right? How do you model it? How do you calculate that? And and, his buddy, whose name escapes me at the moment, his buddy sat down and said, well, how would you determine the probability of winning at solitaire? Now you could do that mathematically, or you could play a hundred games and count the number of ones that you won. And that was the beginning of Monte Carlo analysis, which which plays a huge role in the rest of the book. It drives the whole notion of Monte Carlo analysis drives nuclear physics for a good long time, but it also drives the creation of object oriented programming. It's it was Christian Nygaard's thing. He was a Monte Carlo analyst.
Uncle Bob Martin [00:41:13]:
And because of that, he started thinking about simulation and how to do simulation well. And, of course, then you bring in computers, and he wanted to create these the Monte Carlo compiler. And he recruited, he recruited his buddy, Ole Johan Dahl, and wrote this thing that they initially called the Monte Carlo compiler. It eventually became called Simula. And in the midst of all that, they literally invented object oriented programming.
Dan Shappir [00:41:43]:
And in the context of JavaScript, because this is JavaScript Jabber, I think Java JavaScript borrows from self, and as I recall, self borrows from similar.
Uncle Bob Martin [00:41:53]:
Yeah. Well, there's there's there's definitely something to that. The the story that I have heard, and I don't know that this is absolutely correct, but the story I've heard about JavaScript is that it was it was Brendan Ike's task to create a language that would run-in the browser. This is back in the Netscape scape days, the Mozilla days. And he wanted to make it lisp, but he didn't have time and there was self there and he kind of borrowed from that and cobbled together this thing called JavaScript. That may be an urban legend. I've I think I've seen that once or twice in various threads on the web. I don't know if that's true at all, but I think it's funny.
Charles Max Wood [00:42:32]:
If if you wanna hear the full deal from the horse's mouth, we have an episode where we had Brendan.
Uncle Bob Martin [00:42:38]:
Oh, with Brendan? I?
Dan Shappir [00:42:39]:
Yeah. Oh, beautiful. Yeah. Oh, beautiful. I I also conversed with him about this online even though I wasn't yet with the podcast when you recorded that episode with him. It's it's first of all, it's not exactly that. He was toying with the concept or the possibility of putting scheme in the browser, but it never really matured. And, yes, he did create and implement JavaScript in ten days, which are fondly known in the community as the ten days of glory.
Dan Shappir [00:43:11]:
But he said that JavaScript in a lot of ways is more influenced by, ARC than it is by Scheme.
Uncle Bob Martin [00:43:20]:
Like ARC?
Dan Shappir [00:43:23]:
For those of you who don't know, ARC is kind of like Pearl. Oh. It's a language for text processing.
Uncle Bob Martin [00:43:32]:
Ajo, somebody, and Kernaghan.
Dan Shappir [00:43:36]:
Correct.
Uncle Bob Martin [00:43:36]:
Who's the who's the w?
Dan Shappir [00:43:38]:
I forget.
Uncle Bob Martin [00:43:38]:
I can't remember who the w is.
Dan Shappir [00:43:40]:
It's one of those Remember? Unix utilities that you you can pipe stuff in and pipe stuff out.
Uncle Bob Martin [00:43:46]:
And The predecessor of Pearl. Yeah. Exactly. Predecessor of Ruby. Yep. The author is cool,
Charles Max Wood [00:43:53]:
actually. I I think it's a cool tool anyway.
Uncle Bob Martin [00:43:57]:
By the way, the very first Wiki ever put on on on the Internet was, couple of hundred lines of Pearl written by Ward Cunningham in, the very late nineties. Just, you know
Dan Shappir [00:44:11]:
Well, CGI scripts. You know? People people don't remember the origins of the web, but, the initial web servers were mostly done in Perl because people didn't wanna do all that text processing in c.
Charles Max Wood [00:44:25]:
Yep. So I have another question. I'm gonna change this topic a little bit because, you know, we talked about how computers were initially kind of these calculating machines. And if you go watch, like, the hidden figures movie. Right? They they have these women that are called computers and right? And their job was to do the math. Right? And then they got this fancy computer that would do the math. Right? And so then they were programming the computer. But when when did computers kinda go from this math machine to this sort of general purpose machine that we kinda think of as a computer today?
Uncle Bob Martin [00:45:00]:
That's a really interesting question, and there's two ways to look at that. You could look at it from a from the practical point of view. When did computers start doing more than just math? When did they really start doing more than just math? And and the guy who comes to mind there is Dijkstra because Dijkstra was the guy who was playing with, graph theory. He he came up with this this clever way of of computing the the best route to go from one city in Norway to another, something like that. And it was a demonstration. He wanted to show it show this demonstration to his, superiors. And he came up with this algorithm to do that. And that's a a very different kind of problem than, computing the, implosion wave in a plutonium core.
Uncle Bob Martin [00:45:52]:
So Right. So, that was a more practical one. So from that point of view, you could lay this at Dijkstra's door, and that would have been late fifties. Maybe the early sixties, but probably the late probably the mid fifties, actually. But it was Babbage in his con his his contemplations of his analytical engine, the thing that never got built, right, who started toying around with the idea that this machine that he had in his mind that had a thousand registers and a and a mill that could add, subtract, multiply, and divide, and an electromechanical no. Excuse me. A mechanical bus that could move numbers from registers to the mill and back again. Right? And was programmable by, punched pieces of wood.
Uncle Bob Martin [00:46:43]:
You know, Jacquard loom style. Right? These big chunks of wood with holes drilled in was how you would punish them. And and give it or even that's how you program them, punish them. Good word, Bob. That's how you would program them. And in the midst of just thinking about this machine, Babbage starts realizing that you could write a program for this machine that could play chess. He would he started working that out. Right? So in that sense, Babbage is the first guy to cross that boundary, to get out of the mathematical world and into the symbolic abstract world.
Uncle Bob Martin [00:47:25]:
And he had a number of other ideas like that. He actually put together a machine that could play tic tac toe. He actually built that one. Knots and crosses, although, you know, simple machine to build. Still, he was he was probably the guy that first had that concept.
Dan Shappir [00:47:43]:
That's amazing. I didn't consider that.
Uncle Bob Martin [00:47:45]:
Yeah.
Dan Shappir [00:47:50]:
There are several people that you decided not to include in your book. Few that come to mind are Donald Knuth or Church. You know, if you were looking more recently, maybe somebody like, Linus Trovaldis. So how did you decide to leave certain people out?
Uncle Bob Martin [00:48:14]:
Those are not conscious decisions. I did not have a list of people to leave out. What I did have was a hard cutoff date. I wanted to I wanted it to be a history book about other people, right through the late sixties into the early seventies. And then from that point, that's where part two of the book begins. Then it start starts to become autobiographical. From that point on, I can I can relate what was happening in the industry as an eyewitness, as a participant? So I shifted gears entirely and just started talking about my experiences, through the next thirty years. Thirty or forty, whatever it is.
Uncle Bob Martin [00:48:56]:
Some number of years. And I describe the industry from a, from an insider's point of view at that point. So the hard cutoff date was one of the reasons that you can't put that I didn't put, Linus in there, for example. People have complained a lot that I should have put Margaret Hamilton in there. Right? And I would have loved to. I actually bought a whole bunch of books on the Apollo program to read about that, but it turns out there's not a lot written deeply about the the stories there. Or or if there is, I missed them. So, you know, I went to look for that but didn't find it.
Uncle Bob Martin [00:49:35]:
Limited amount of time, I thought, okay. I can probably skip that one. There's a number of other people that I should have written about if I'd had the space like John McCarthy. I would have loved to have told an in-depth story of LISP. That would have been a great story to tell. Just, you know, ran out of time, ran out of of materials.
Dan Shappir [00:49:54]:
Engelbert and the mother of all demos.
Uncle Bob Martin [00:49:57]:
I'm sorry?
Dan Shappir [00:49:58]:
Engelbert and the mother of all demos.
Uncle Bob Martin [00:50:00]:
That's a story I don't know.
Dan Shappir [00:50:03]:
Check out the video for the mother of all demos. Basically, it's you can find it on YouTube. Let me do a quick search.
Uncle Bob Martin [00:50:12]:
The mother of all demos. Sounds good.
Dan Shappir [00:50:16]:
Yeah. It's still considered to be the greatest demo of all time.
Charles Max Wood [00:50:22]:
It's like I see a couple of them here. One of them is, like, an hour and forty minutes.
Dan Shappir [00:50:26]:
Yeah. It's pretty long. Basically basically, while everybody was doing punch cards so this this happened let me do I'm looking at Wikipedia. It happened in '68. So everybody was still doing punch card. This guy, comes along and well, guy. He was a professor. He does a demo.
Dan Shappir [00:50:47]:
I think he was a professor. A ninety minute demo, live demonstration, showing stuff like Windows, a mouse, drag and drop, copy paste, hyperlinks. 68.
Uncle Bob Martin [00:51:03]:
Yeah. Well, okay. It's where Alan Kaye got the idea.
Dan Shappir [00:51:08]:
It's pretty nuts. And he does this in this kind of deadpan voice, and, you know, he's wearing a suit and tie, and it's he's he didn't do it for, you know, it it it wasn't like a CEO talking up there. This is like, you know, academics talking about stuff. So it's it's but it's I I highly recommend for our listeners to or or for you, if you're not familiar with it, to go to YouTube and and just, you know, search for the mother of all demos and watch the video.
Uncle Bob Martin [00:51:42]:
Yeah. It's a video mainly.
Charles Max Wood [00:51:43]:
It's great.
Dan Shappir [00:51:51]:
So you said that the second half is kind of autobiographical. When did you enter the industry?
Uncle Bob Martin [00:52:00]:
I, I got my first job as a programmer at, age it was either 16 or 17. I can't remember exactly. And it was a summer job, and it was very temporary. And my father had actually gone to this company who was just a few miles down the road and had walked in there and said, you will hire my son. That was the kind of person my father was. And I found myself working at this place. And it was, like, two weeks two or three weeks that I was there, and I wrote a little bit of assembly language under the the, watchful eye of my supervisor. Got one little program working, and then he said, well, thank you very much, Bob, and now your time here is done.
Dan Shappir [00:52:42]:
When was that if I might ask?
Uncle Bob Martin [00:52:43]:
That was yeah. I was I think I was 16. That would have been I was born in '52, so I would have been 60 eight ish, something like that. I went back to that company, like, a year and a half later, and for a while, I operated offline printers, printing junk mail on third shift, and then, rapidly became a programmer. I think I spent about six months doing the offline printers, but knew some guys who were programmers and talked to them and convinced them that I probably could be could be writing code. And and from that point, I was writing a little bit of COBOL, which I hated. And then from then on, it was, mini computer assembly language, and a lot of it. So that was that's when I got my start.
Uncle Bob Martin [00:53:29]:
So I guess you'd have to say, really, my career began in the very, very early nineteen seventy, maybe late sixty nine.
Dan Shappir [00:53:41]:
And, oh, did you also go to university or college or or something
Uncle Bob Martin [00:53:46]:
like that? No. This is like the Vietnam War era, and the universities were all going nuts. And, my family wasn't really very well off. And in the meantime, I had devoured books on COBOL and PL one and Fortran and PDP eight assembly language. I was a real computer nerd. Still am.
Dan Shappir [00:54:07]:
So you're the original self taught developer?
Uncle Bob Martin [00:54:11]:
Well, probably not. One of them I mean, self taught. I think Grace Hopper was self taught. But but one of the But she did
Dan Shappir [00:54:20]:
come from academia, I believe.
Uncle Bob Martin [00:54:22]:
She did. Yeah. She was she was a mathematics professor. Yeah. At at, I can't think. Vassar? I can't remember.
Dan Shappir [00:54:29]:
Look. I I have to say that, you know, today, CS departments are departments on their own. But when I studied in the university, the CS department did not exist. It was part of the, the math department.
Uncle Bob Martin [00:54:44]:
Yeah. I mean It only came into existence
Dan Shappir [00:54:47]:
a couple of years later.
Charles Max Wood [00:54:49]:
Yeah. Sure. Anyway, you're gonna be the CS department.
Uncle Bob Martin [00:54:53]:
If you wanted to be a programmer in 1969, there weren't a lot of courses you could take, and access to computers was very difficult. And that was one of the problems that Kemeny was trying to solve. Kemeny was at, oh, jeez, one of the colleges out there. I can't remember where it is, on the East Coast. And, you know, access to computers was a really big problem. They eventually got time on, one of the computers at MIT, and, they would they would do it by schlepping punched cards, several miles. One of the guys would get on a train and and haul punch cards up there and run the jobs and then come back with listings. And so if you were a student, you would submit a program and maybe a week later, you got a listing.
Uncle Bob Martin [00:55:49]:
And Kemeny wanted to solve that problem. And he bought a little mini computer at it was a really dinky little thing, and and maybe he had six students that really learned how to do it very well. And then it occurred to him that he needed a bigger machine, and he and he wrangled General Electric to give him, for for a very, very low price, a couple of big honking GE machines. I actually worked on on a machine like that at about that time, at that at that same company, General General Electric, Datanet thirty. Really in really big in those days, big machines. And he and his buddy and a few, undergrads wrote in assembly language a time sharing system and a basic compiler in about six months and turned the student body loose. They had a whole bunch of teletypes that they just scattered around the the the the school, Dartmouth. They scattered around Dartmouth.
Uncle Bob Martin [00:57:00]:
And, the students could suddenly find themselves writing code and seeing it execute in the same session within minutes. And what did the students do? They wrote games.
Dan Shappir [00:57:16]:
Well, then you did bring up the fact that, that, Richie and Thompson and Richie created the Uniques and c because they wanted to play games. They wanted to
Uncle Bob Martin [00:57:29]:
play Space War.
Dan Shappir [00:57:33]:
Yeah. By the way, one of the things that I'm really sad about is I remember in the nineties or something, get a copy of the I triple e Spectrum magazine talking about the origins of the, video game industry, Atari and and whatnot. And, unfortunately, I did not keep it. And and, some crazy stories there as well. I mean, the the original Ataris had one k of RAM, which, you know, think about that the next time you're writing your five megabyte your your your 30 megabyte web application that does absolutely nothing. Or you play They they wrote Space Invaders in one k.
Uncle Bob Martin [00:58:12]:
You got a bunch of guys out there on the net going, okay, boomer.
Dan Shappir [00:58:18]:
I I I don't deny it.
Charles Max Wood [00:58:22]:
I remember playing games on the Atari. I mean, I was, like, six.
Dan Shappir [00:58:25]:
But Well, I can tell you a funny story is that it was the device was limited to four colors. And one of the games, they wanted to have eight colors. So they wanna have four different colors at the top and four different colors at the bottom. So what they did is they actually synchronized the game loop with the television refresh, and they would switch the palette of the colors mid screen. Oh, wow. So they that that way, they could get four different colors at, you know, the two halves of the upper part of the screen and the lower part of the screen.
Uncle Bob Martin [00:58:59]:
There was a lot of that kind of shenanigans going on.
AJ O'Neil [00:59:05]:
I love, video game podcasts, like and and the YouTube channels like Modern Vintage Gamer and, Video Game Historian doesn't really do much anymore, but the stuff that's there is great. I love learning about all those tricks that I think Modern Vintage Gamer just did one on. I think it was the Nintendo that does that, that that where they're doing that, where they're swapping on the chip. They're swapping what's being presented to the thing that's reading it in real time with a little microprocessor so that they can get two color palettes.
Dan Shappir [00:59:45]:
Yeah. They can't afford the garbage collection in the middle of their loop.
Uncle Bob Martin [00:59:52]:
It's all written in assembly language.
Dan Shappir [00:59:55]:
Alright. Well, I've got a few
Uncle Bob Martin [00:59:56]:
two is coming up in ten minutes.
Dan Shappir [00:59:58]:
So Yeah. Just as in in this interesting aside, we were talking we were mentioning Lisp. Lisp in the, I believe, fifties or sixties, I think, introduced the concept of garbage collection.
Uncle Bob Martin [01:00:08]:
Yeah. That's true. Yeah. Nygaard and and, Dahl, needed garbage collection in their in their, Monte Carlo compiler. And they tried to write their own, and then eventually, they bailed out and and borrowed McCarthy's, the concept of McCarthy's garbage collector. And that's what they put into Simula for a while.
Charles Max Wood [01:00:29]:
Alright. I'm gonna push this to fix because I've gotta go. I have I have a call in ten minutes.
Uncle Bob Martin [01:00:35]:
Okay. Alright.
Dan Shappir [01:00:36]:
I could talk history forever. I know. Right?
Uncle Bob Martin [01:00:41]:
I know. It's the it's the glory days.
Charles Max Wood [01:00:45]:
We'll get Bob back when, Clean Coaters comes out. We'll see if we can get him on Ruby Rogues and go into more of this stuff. But, yeah, let's do picks, and let's be fast because I want to be able to do them. So, AJ, you wanna start with the picks?
AJ O'Neil [01:01:00]:
Yeah. I'll just pick a short one. No. No. I can't do that. But The Expanse, I finished book two. And I just have to say so far between book one and book two, the book is like, the book and the TV show are very, very, very similar. Mhmm.
AJ O'Neil [01:01:20]:
If I were to describe the plot of them, they're pretty much identical. But the book is so much better because in the TV show, they cut out, like, critically important elements that are absolutely essential for you to understand why they transitioned from what seemed like two completely different TV shows with the same actors between season one and season two, where it's like, okay. These are not related other than it's the same people. There's, like, a few key pieces that if you know, it's like, oh, okay. Now I can have suspension of disbelief again. And then likewise, there's so much stuff that they added into the TV show that's completely irrelevant and just draws out like a couple extra episodes. Man. Yeah.
AJ O'Neil [01:02:06]:
So if if The Expanse didn't hit for you on the TV show, but you you like the first the first season, and and you wanna know where it goes, I I think I think the books are better. Chuck, you'll have to to chime in to, you know, if the is the ending satisfying after, what is it, six books or
Dan Shappir [01:02:25]:
nine books or something?
Charles Max Wood [01:02:26]:
But they don't they don't do all the books in the TV series. So just somewhere.
AJ O'Neil [01:02:32]:
They cut out pretty early.
Charles Max Wood [01:02:33]:
The the books are are very, very good, way better than the the TV shows. I had the benefit of having read the books before I watched the TV show. Also, fair warning, there's a little bit of a gap because the sci fi folks dropped the show, and then Amazon Prime picked it up. And so there was, like, a year where they didn't record. But, yeah, anyway, it's it the the TV show is terrific, but the books are and, yes, they still do stay pretty, pretty close to the books. So yeah.
Uncle Bob Martin [01:03:07]:
Yeah.
AJ O'Neil [01:03:07]:
So to keep things short, that's that's all I'll pick today is just got finished with that book, and I liked it. And I do have to say, Avalosara is worse in the book than in the TV show previously. I complained all she does in the TV show was come in, say the f word a couple of times, and leave. Yeah. She's the same in the book. Like Better
Charles Max Wood [01:03:28]:
in the as the books go on.
Dan Shappir [01:03:30]:
Okay.
Charles Max Wood [01:03:31]:
Dan, what are your picks?
Dan Shappir [01:03:33]:
Yeah. So I called dibs actually on this pick when it came along Fair. Because it's so great, and it's kind of related to some of the stuff we were talking about today. So it turns out that, this guy called Dimitri Mitropoulos, I hope I pronounce his name correctly, implemented the game Doom in the TypeScript type system. Because as we all know, the TypeScript type system is Turing complete. It's effectively a dialect of, Lisp, I think, in a certain way because you can implement loops with recursion, and you also do case, if statements, you know, along these lines. So he basically managed to implement something like, a compiler that that something that takes, I think, LLVM code and basically translates it into TypeScript types. It took him all of a year of working ten hour days to implement, and I think he has it running at something like a frame a week.
Dan Shappir [01:04:45]:
But it works, and it's the most insane thing I've ever seen. He put a video up. He said he'll put two more, one that he talks about, you know, he'll go into the details of how he actually implemented it, and I'm really trying to get him to come on the show.
Uncle Bob Martin [01:05:01]:
Oh.
Dan Shappir [01:05:01]:
If you're listening, please do. I've reached out to him, and I hope that I'll be successful. I you know? He did something like there's something like, a trillion types in in the code, something like that. He he had to remove all the limits out of the TypeScript compiler source
Charles Max Wood [01:05:20]:
code. Hope y'all.
Uncle Bob Martin [01:05:23]:
Okay. Wow. I wish I had copious amounts. Worthwhile project.
Dan Shappir [01:05:29]:
Yeah. You know, it's,
Charles Max Wood [01:05:30]:
It's gonna change humanity.
AJ O'Neil [01:05:32]:
This was very different from the the Floppy Bird implementation. Well Because Floppy Bird was a was an interpreter, and this is LLVM.
Dan Shappir [01:05:43]:
Yeah. Something wrong. If I understood correctly, like I said, we really need to get him on the show. But, you know, the the funny thing, though, it's we we talk about is is the fact that, yeah, the the type system in in certain programming languages, you know, TypeScript, also kind of c plus plus comes to mind. I think even Java to an extent is effectively a touring complete programming language in in and of its own because you can implement recursion, and with with halting conditions. So, yeah, it's pretty nuts. Anyway, you can't top that, and that would be my pick for today.
Charles Max Wood [01:06:21]:
I can't top that. I'm gonna throw out two picks really quick. I'm gonna do a card game. I've picked it before. I've picked it recently, but it's the one that I've been playing the most lately. It is the gang, and it's basically cooperative, Texas Hold'em poker. And so, what what you you all get dealt your pocket cards. You you do you know, you flip the river and the flip and the flop.
Charles Max Wood [01:06:47]:
Right? And, at each stage in the game, there are chips for each there's one for each player. You know, one up to however many there are. Whoever thinks they have the winning hand will grab the top one. Right? Sometimes you fight over the chips. And then, you know, you go around. And eventually, once you settle on the chips, then you do the flop or the the river. And you, you know, so you get three more cards and then right. And so then the the chips change hands because right now you have a pair or two pair or three of a kind or whatever.
Charles Max Wood [01:07:23]:
And, anyway, it's it's super fun. So, you know, it it takes about twenty minutes to play a game. I played it with four and five people. It gets a little harder when there are more people, but it's totally fun. So I'm gonna pick that. And then the other one is I've been watching the latest season of Reacher. I watch a lot of these kind of action kind of shows. I I really enjoy them.
Charles Max Wood [01:07:45]:
I have to say the plots aren't always that creative. Right?
Dan Shappir [01:07:49]:
They they
Charles Max Wood [01:07:50]:
have a lot of the same They're
Dan Shappir [01:07:51]:
not supposed to be.
Charles Max Wood [01:07:52]:
But, you know, I can just, you know, I can just sit and veg and turn my brain off. So, anyway, I'm enjoying that. They're, like, four episodes out now. So, reach her on Amazon Prime. Bob, what are your picks?
Uncle Bob Martin [01:08:05]:
In the spirit of ancient history, there are a couple of science fiction books that are worthy of a good solid read even though they're very old. The books that come to mind, they're a hundred years old, are when worlds collide and the sequel, after worlds collide. And don't don't get confused by, Velikovsky's worlds in collision. That's not the books that I'm talking about. When worlds collide and after worlds collide. Wonderful stories, written in the, I think, the nineteen twenties about, an astronomical collision with the planet Earth and the and the way the scientists of the age find a way to survive. But I won't go any further than that, except to say that it's very colorful and lovely and wonderful science fiction if you can tolerate the, glaring scientific errors that would have been obvious in the nineteen twenties.
Charles Max Wood [01:09:05]:
Awesome. Can can can you do spoilers after a hundred years? I I guess maybe you could. Anyway, Bob, if people wanna find you on the Internet or connect with you, where do they where do they find you?
Uncle Bob Martin [01:09:18]:
CleanCoater.com. That's my website. Cleanc0der.com. You can go there. Twitter handle is uncle Bob Martin. Beware. And, other than that, just around.
Charles Max Wood [01:09:34]:
Alright. Good deal. Well, thanks for coming, Bob. This was fun.
Uncle Bob Martin [01:09:37]:
My pleasure always.
Dan Shappir [01:09:38]:
This was awesome. Thank you so much.
Charles Max Wood [01:09:41]:
Alright. We're gonna wrap it up. Till next time, folks. Max out.
Hey. Welcome back to programmer story hour with uncle Bob or JavaScript Jabber, as as we call it every week. This week on our panel, we have AJ O'Neil.
AJ O'Neil [00:00:17]:
Yo. Yo. Yo. Coming at you live from the now with plywood paneling shed. Or, like instead of drywall, I got some plywood from a friend who is dumping it.
Charles Max Wood [00:00:29]:
Nice. We also have Dan Shapiro.
Dan Shappir [00:00:32]:
Hello from Tel Aviv.
Charles Max Wood [00:00:34]:
I'm Charles Max Wood from Top End Devs. And this week, we have a special guest. As I said before, we got uncle Bob here. So, Bob, welcome back.
Uncle Bob Martin [00:00:42]:
Thank you so much. Good to be back.
Charles Max Wood [00:00:45]:
So, I was I was gonna ask you what's new, but, I have to say, Pearson reached out to me about reviewing Clean Code, a new edition of Clean Code. So it looks like that's gonna be a thing.
Uncle Bob Martin [00:00:57]:
Yeah. I'm in the midst of, the final reviews of that now, so it should be going into production within another month. And then, you know, that that process takes about three or four months. So
Dan Shappir [00:01:09]:
Even cleaner code?
Uncle Bob Martin [00:01:10]:
End of the year. What's that?
Charles Max Wood [00:01:12]:
Even cleaner code? We can only pray.
Uncle Bob Martin [00:01:16]:
Clean code second edition. Now I tried to play with other titles, but the publisher was very adamant. Yeah.
AJ O'Neil [00:01:23]:
He didn't
Uncle Bob Martin [00:01:24]:
get clean codes second edition.
Charles Max Wood [00:01:26]:
I think it's easier to sell if you keep the title.
Uncle Bob Martin [00:01:28]:
It's You know? Yeah.
Dan Shappir [00:01:30]:
We're not supposed to that's not that's not the topic of our conversation, but I've got to ask. I mean, the clean code principles seem pretty kind of universal almost. So why do we need a second edition?
Uncle Bob Martin [00:01:44]:
Oh, heavens.
Charles Max Wood [00:01:49]:
I did say story hour. Go for it, Bob.
Uncle Bob Martin [00:01:53]:
For the longest time, I thought, you know, I'm done. I I don't I've never done a second edition of anything. Usually, when I write something, I think, okay. I said it. I don't need to say it again. And for the longest time, I thought that would be the case with clean code. But the clean code became so controversial. There were so many misinterpretations and misrepresentations and, you know, errors on my part where I said things that could be taken in the wrong way that I thought, you know, maybe it's time to dust that thing off and see if there isn't something I would say differently.
Uncle Bob Martin [00:02:31]:
And then as I was doing that, I thought, you know, there's all this new stuff. There's all this AI stuff. There's always, you know, Copilot and Grok and all that stuff. How does that play in? And and besides that, there's languages that I should probably explore, like Go. And and I thought, okay. Fine. Let's let's do a top to bottom rewrite incorporating some of the original chapters with a lot of, changes and just a whole new bunch of new chapters. The overall message is, of course, the same, but the way I say it and the examples that I pose and some of the the nuances have shifted a a rather significant amount.
Uncle Bob Martin [00:03:15]:
So I'm I'm happy with it. I also decided to add a whole bunch of other stuff like design principles and design patterns. It's kind of like, okay. Everything I've learned over the last ten years, let's kinda funnel it into this book and and see what happens. So that's why there is a second edition. Not least, of all of that is that my publisher said, you know, you should write a second edition. I thought, okay. Probably a good idea.
Dan Shappir [00:03:45]:
Awesome. You you mentioned the fact that you cover new program additional programming languages in your new in your the new edition.
Uncle Bob Martin [00:03:53]:
Yeah.
Dan Shappir [00:03:54]:
I'm curious in that context, How to what extent does the choice of the programming language impact the meaning, I guess, or the consequence of the code being clean? Like, would would you apply the same principles in for in order to achieve clean code in different programming languages?
Uncle Bob Martin [00:04:19]:
And and that is one of the points of the second edition, which is that the programming language doesn't matter much at all. I I'm gonna show you an example in Python. I'm gonna show you an example in Ruby. I'll do one in closure. I'll do one in Java, a two one in c. Doesn't seem to make an awful lot of difference. There are little quibbles that you can make. Some languages want the order of the functions inverted.
Uncle Bob Martin [00:04:48]:
You know, if you're working in Python or or if you're working in closure, they want low level things stated before high level things.
Dan Shappir [00:04:54]:
I hate that.
Uncle Bob Martin [00:04:55]:
Whereas in Java, you can turn it around in a way that makes more sense. But overall, the the the message of the book, applies to all of those languages. And and in the second edition, I tried to demonstrate that by just changing language from chapter to chapter to chapter.
Charles Max Wood [00:05:13]:
Yeah. I remember
Uncle Bob Martin [00:05:14]:
when With the help of Copilot, by the way, because I'm not a Python programmer. So I fire up Copilot, and I get a lot of help. It was it was, it was pretty interesting to watch these AIs, throw code at me that I could review and then think, you know, that's maybe not so bad or in more cases, like, I think I could do better.
Charles Max Wood [00:05:37]:
Very cool. We're looking forward to that coming out.
AJ O'Neil [00:05:40]:
One thing that I hear is, like, the number one criticism that I hear, and I I think this is not accurate, but I I wanna know. People say, oh, or you could do it uncle Bob style and only have three or four lines in a function. Is that is that true, or is that just, like, a misquote or a perversion of something you said? Like, I know that a lot of demo code examples to do apps, whatever. Yeah. Like, you end up you know, if you were gonna enterprise it and, yeah, then you're gonna end up with a bunch of things that are three or four lines long that don't do anything meaningful. But what what is your actual advice on function size or or grouping of logic?
Uncle Bob Martin [00:06:28]:
Actual my actual advice there is to keep it very small. I like small functions. And, you know, how small? Well, three, four, five, six, seven lines. Something in that range. I don't like to see 20 lines. I don't like to see 30. The the, controversy is, you know, two to three lines. Everybody says, oh, Bankabob says everything's gotta be two to three or or three to four or whatever number they they quote.
Uncle Bob Martin [00:06:59]:
And that's that's an example of people who did not read the book.
Dan Shappir [00:07:05]:
In that context, though
AJ O'Neil [00:07:06]:
That's what I figured.
Dan Shappir [00:07:07]:
That some some programming languages are more condensed than others.
Charles Max Wood [00:07:12]:
Yes. There are.
Dan Shappir [00:07:14]:
You know, you I know that you like closure. Closure is pretty dense.
Uncle Bob Martin [00:07:18]:
Very dense. So
Dan Shappir [00:07:20]:
three lines of closure could probably achieve a lot more than three lines of Java. Three lines of Java, two of the lines are open are open curlies and closed curlies.
Uncle Bob Martin [00:07:30]:
Yep.
Dan Shappir [00:07:31]:
So you're basically left with one line. That is Java.
Uncle Bob Martin [00:07:35]:
Certainly true. It is certainly true that that closure is much denser than Java, and yet it is much harder in closure to make small functions. And that's just because of the the functional style and the fact that you need to set a bunch of variables up front and then and then operate them at a lower place. And it's very hard to separate those things out as independent functions. So just just a quirk of the language, you end up with larger functions in closure even though those even though the language is denser.
AJ O'Neil [00:08:12]:
So do you have, like, a general rule of how to determine what belongs together. Because I think line limit to me to me personally, I don't think line limit makes a lot of sense because the line limit is arbitrary. Like, for me, I don't like to use comments. I put everything in a variable. So if I'm gonna do a mathematical operation where I'm gonna, you know, add days of the week and multiply by hours or whatever, I'll actually write that out line by line so that instead of commenting, this is taking this to make that because this number is special. I'll just var special number equals, you know, and and and that way that the variables declare themselves. So a function that somebody else would have that would be or or a operation. Like, I I break statements down.
AJ O'Neil [00:09:03]:
Right? So I don't I don't actually find line numbers in of themselves to be meaningful. Other than that, you gotta be able to see it on a page. Like, when you're looking at a block of code, generally, you should be able to see the whole block of code. If it extends beyond what you can easily see or you have to make your font size really small, then, you know, it's too much context in the brain.
Dan Shappir [00:09:23]:
I've got these. I don't make my font size too small.
AJ O'Neil [00:09:29]:
Yeah. But but on the other hand, and I and I think that there's the general case versus the exceptional case. This might be exceptional case. But if it's like a parser, I often find that my functions are way longer longer than I like them to be because it's like, well, one unit of logic for parsing this thing is just this much logic or transforming if it's like a parser or a transformer.
Uncle Bob Martin [00:09:57]:
Yeah. Yeah. So the line limit is always the wrong way to look at it. Right? It's just because it's not a line limit that you're really going for. And in the book and in the new book, especially, I I write a whole chapter about this in the new book. But in the old book, the rule was a function should do one thing. And how do you know that it's doing one thing? How do you remove the objective or the subjective, idea of what one thing is? And my answer to that is is that if you can use the extract method refactoring inside a function to pull another function out of it, you probably should. And then give that function a nice name, and those two functions will then do one thing.
Uncle Bob Martin [00:10:42]:
If you can take one function and split it in two with extract method, then you then that then probably you should, and those two functions will be smaller, of course. They'll both have nice names. That's that's my fundamental rule.
AJ O'Neil [00:10:57]:
If you don't know what to name your function, if your function name is do stuff, you definitely need to break your function down.
Dan Shappir [00:11:06]:
I literally once, had to, refactor code that had init one through init 10.
Uncle Bob Martin [00:11:14]:
Oh, jeez. Yeah. So But That's that's useful.
Charles Max Wood [00:11:20]:
But the the
AJ O'Neil [00:11:21]:
They kept the line rule.
Charles Max Wood [00:11:22]:
The thing that we're we're kind of circling around here, at least the way that I approach it is, I like everything at the same abstraction level for one.
Uncle Bob Martin [00:11:30]:
Yep.
Charles Max Wood [00:11:30]:
And so that's one rule that I follow. Right? And so if I can say this takes these steps a, b, c, d, e, f. Right? And I can, you know, I can name the steps. Then then that's usually what my function looks like, right, or my method or whatever. And then and then I have those somewhere else. Right? And so they and then those break down the same way. They're just the next layer of abstraction. But then the other thing is is that if, typically, if I have some big long function like, AJ's talking about with, like, a parser, usually, there are different stages or steps or functionalities in there that that I need to go through.
Charles Max Wood [00:12:04]:
And so I can break all that out too. And so in a lot of cases, I don't typically find very many cases in any language that I've written where I don't wind up with just some somewhat shorter method. The only time it gets particularly long is if you have a case statement, and I hate case statements because it it adds the line every other time. If if case case, then do this. Case, then do this. Case, then do this. Or if else if else if else if else if, which is also gross. But beyond that, yeah, typically, you can break it out into multiple
Dan Shappir [00:12:39]:
I prefer in direction over ifs and and clients switches. By the way, we have a question from the audience. Clojure, from Vinicius. I think I'm pronouncing his name correctly. I hope. Clojure developers value recursion more than any other. How does recursion impact clean code? Well, I think that Clojure developers don't have a choice except to use, recursion if they want to have to make, to create loops. You know, one of the people you didn't talk about in your book or a few people were, were church, and also I forget the name of the two guys that created Lisp.
Charles Max Wood [00:13:20]:
Oh, yeah. We're here to talk about we programmers
Uncle Bob Martin [00:13:22]:
and the history of programming.
Charles Max Wood [00:13:27]:
Go go ahead and answer this question, Bob, and then we'll move on and move on to story hour.
Uncle Bob Martin [00:13:32]:
Well, I mean I mean, Dan is right. If you're going to use a functional language, you have no choice but to use recursion. Recursion is a, the only way you can do loops in a in a functional language. How does it impact clean code? It doesn't. Good good expressive code can be expressed either with iterative loops or with recursion. So there's no real impact there at all. The the impact that closure brings to the rules of clean code is that, the act of creating intermediate variables is very difficult to extract out into other functions. Because enclosure, when you create an intermediate variable, it is in the scope of your function, and there's no way to get it out without doing some nasty trick like creating an atom or something.
Uncle Bob Martin [00:14:29]:
And okay. So probably don't wanna do that too often.
Dan Shappir [00:14:33]:
Because you don't want side effects.
Uncle Bob Martin [00:14:35]:
Alright. Right. Yeah. Yeah. I mean, you can manage those side effects by creating an atom and then making sure you don't overwrite the data that you stick in there. So in that sense, you probably could pull out those functions. And I've I've played with that technique a few times, but it's always ugly. So then I wind up with with functions that are 15 lines long, and I look at them and go, boy, I wish I could pull these things apart, but there's no real good way so far in closure that I have accepted.
Dan Shappir [00:15:08]:
Also, at the end of the day, it's not about achieving like you said, it's not, like, about achieving some magic number. It's Yeah. It's trying to make your I guess it would be try to make your functions as so as short as possible, but no but no shorter. Well Yep. Well Given
Uncle Bob Martin [00:15:25]:
the constraints of the language.
Charles Max Wood [00:15:26]:
And it it's it's not easy either. I think people kind of conflate length and complexity or length and difficulty and, you know, it it can and can't sometimes. But was it Mark Twain that said I didn't have time to write you a short letter, so I wrote you a long one?
Uncle Bob Martin [00:15:41]:
Who is Voltaire?
Charles Max Wood [00:15:43]:
It it was somebody important.
Uncle Bob Martin [00:15:45]:
But the
Charles Max Wood [00:15:45]:
point is is that it takes a lot of time to get right to to really get things at the in the right place so that you have something like that that's easy to put together in your head. Anyway, let let's get into we programmers. I think we did this last time when we were talking about your your other project where we went off on we programmers for about twenty minutes, and then it's like, no. We were here to talk about this other thing. So which is great because it makes it fun to talk to Bob. But, yeah. So I I'm kinda curious as we get in, what's your favorite part or story or whatever of the book, and can you kinda give us a little bit of the the story there?
Uncle Bob Martin [00:16:27]:
The fate my favorite story in there. Well, there's a lot of lot of stories that I really like, but my my favorite story in there might be the story of John Bachus. Because here's a guy, he who was a complete ne'er do well. He didn't have a great family life growing up, kinda dumped on school, didn't care about school because he's too damn smart. Right? And, you know, you everybody knows that kid who was so damn smart that that they didn't even it didn't even try. Right? School was just so damn boring. The hell with it. And, he got drafted towards the end of World War two.
Uncle Bob Martin [00:17:10]:
Fortunately, right at the right time, he got drafted. And and, the army saw this, you know, this ne'er do well kid and ran him through an aptitude test and it blew their socks off. And so they said, you need to become an engineer, and they put him into engineering school. Well, that was too boring for him. He did extremely well, of course, but it was too boring for him. And he he just spent his time at nightclubs and stuff like that. And, the army goes this right at the end of World War two. Right? So the army says, you know, this guy is so damn smart.
Uncle Bob Martin [00:17:46]:
They put him into medical school. He could become a doctor. And that was a bit more challenging, and Bacchus kind of enjoyed it, but kinda didn't. And then all of a sudden, the war was over, and, he had, he was out of the army, and he just dropped out of the school and said, yeah. The hell with that. And he he built himself a nice little Wi Fi system. Oh, by the way, that's not Wi Fi. Hi Fi back in the, you know, in the fifties.
Uncle Bob Martin [00:18:17]:
Nice sound system for his record player. Colin still owe me half of the people in the world know what I'm talking about. He built that, and he dabbled around a little bit. Really didn't get any jobs. And then a friend of his said, you know, you should see this really cool thing that's down, in one of the streets of New York City at the IBM Building. And he goes wandering over there, and he looks in the window. And and the at the IBM Building, Thomas J Watson, the guy who founded IBM, had put in the display window the world's second computer, big computer. Right? The the selective I can't remember the name of it.
Uncle Bob Martin [00:19:03]:
This gigantic machine, mostly electromechanical, couple of vacuum tubes, paper tape everywhere. This massive machine fills the room. It's got this really cool front panel. You know, Star Trek front panel. Lights are blinking. If you go inside, it's clicking away like crazy. And, Bacchus goes, oh, yeah. That's kinda cool.
Uncle Bob Martin [00:19:28]:
And he asks for a tour. And, the person giving him a tour, I think, must have smelled something. I mean, Bacchus was was in a very informal garb, shall we say. But must have smelled something about Bacchus' intelligence because the tour guide brought him up to the department head, and the department head gave him an aptitude test and hired him on the spot. And he became the project leader of the Fortran project that gave us the Fortran language way back in the fifties. That's that is one of the most interesting intellectual rags to intellectual riches stories in the book. He's a guy that you would never expect to do well at anything and winds up delivering this wonderful thing to the world at that time.
Dan Shappir [00:20:22]:
So I I have to ask. I mean, it's the book, I've not read it, but I've read excerpts. I've not read it yet. Let's put it this way. But I've read excerpts, and I also saw some of the stuff that you put out. And there are a huge there's a large number of amazing characters and crazy stories about them. How did you decide who to put in and leave out, and how did you get all the information about the ones that you decided to to put in?
Uncle Bob Martin [00:20:57]:
It's how did I decide who to who to who to leave in and who to leave out? This old Bob Seger song. Right? There were a few that were obvious that I had to put in. I had to put Babich in because the book wouldn't even start properly without Babich. And you have to put Grace Hopper, because she was kinda like the first. And if you're not talking about touring, you're not writing a a book about software history. So you gotta have touring. And if you bring in touring, you have to talk about, the math on Newman. Dave.
Dan Shappir [00:21:32]:
Hilbert?
Uncle Bob Martin [00:21:32]:
Hilbert. Thank you. I knew it was starting with an h. You have to talk about David Hilbert, and you have to talk about John von Neumann. So those were kind of obvious that's an obvious progression. And then, you know, why wouldn't you talk about the three authors of c? Why wouldn't you talk about Dennis Ritchie and and Ken Thompson and Brian Kernighan? You you you in fact, you you're gonna wanna end with that one because that's kind of where modern history begins.
Dan Shappir [00:22:03]:
Yeah.
Uncle Bob Martin [00:22:04]:
And then in the midst of all that, there are these milestones. And most of those milestones, I just uncovered by accident. Like, the the whole story of John Kemeny, the father of basic. What an interesting story that was. No. Everybody knows Basic. Hardly anybody knows the story. Thank you.
Dan Shappir [00:22:22]:
You're making an you're making an assumption that's based on our age.
Uncle Bob Martin [00:22:26]:
No. Okay.
Dan Shappir [00:22:27]:
I I I have to tell you that I speak with the developers that I work with these days. And, you know, sometimes the topic of the first what's your first programming language comes up, and I say basic, and they say what? Yeah. Like, people today don't be it. People today don't know about basic. I mean, you know, maybe they do because of Microsoft, you know, stuff like VBA. But other than that, they probably don't know what basic is. And you know what? That's not such a bad thing. Basic almost spoiled me as a programmer.
Uncle Bob Martin [00:23:05]:
Oh, well, you know. You didn't write COBOL then because that would have spoiled you as a programmer. Spoiled me as a programmer for a day or two.
Dan Shappir [00:23:15]:
Well, you know the story about Ellen Kaye and Grace Hopper?
Uncle Bob Martin [00:23:20]:
Please. Please tell me the story.
Dan Shappir [00:23:23]:
Well, I've I recall reading it somewhere that, he was walking around the university. I guess it would be Stanford, I think. I may be wrong. Maybe it was Berkeley. I I don't recall where he taught. But, anyway, he saw he sees a group of people, and he walks over, and it's because, Grace Hopper was there and they were, like, showing showing her around. And the story is that they introduced them and she they said, this is Grace Hopper. She, created COBOL.
Dan Shappir [00:23:57]:
And he said, oh, I'm sorry.
Uncle Bob Martin [00:24:04]:
Yeah. I am not kind to Cobol in my book. I'm very kind to Grace Hopper, because I think I think she was a remarkable person. But Oh, yeah. For sure. God, I hated Cobol. I I spent about three months writing COBOL when I was 19 years old. It was not a fun time for me.
Uncle Bob Martin [00:24:26]:
So I have I've walked away from that language and never looked back.
Dan Shappir [00:24:29]:
Remember what happened when, COVID hit?
Uncle Bob Martin [00:24:34]:
I I thought you were gonna go for, y two k. So, no, what happened when COVID hit?
Dan Shappir [00:24:39]:
I still remember. I think it was the, governor of New Jersey or something saying that our systems can't keep up, and we we're in dire need of cobalt programmers.
Uncle Bob Martin [00:24:55]:
Yeah. I've actually heard that since. There's a lot of people talking about, these things are all written in cobalt. No? Okay. Fine.
Charles Max Wood [00:25:06]:
Well, it's like any other project that I've worked on. We don't actually update it until it's breaking.
Uncle Bob Martin [00:25:14]:
I think I think some of these are long past that point.
Dan Shappir [00:25:17]:
Yeah. Well, look. Yeah. But they can
Charles Max Wood [00:25:20]:
they can patch it over and
Dan Shappir [00:25:22]:
yeah. Yeah. Well, she also invented the term bug as I recall.
Uncle Bob Martin [00:25:27]:
Yeah. Well, I don't know if that she invented it, but but in her notebook, there is a desiccated moth that she pulled out of the, the relays in the the Harvard mark one. And and in the notebook, it says, this is the bug we found in the machine. So I I believe the term actually came from telephony, maybe even fifty years before that, but she put it in a software notebook, so we can credit her with that. She was, however, responsible for creating the glossary of terms, one of the earliest glossary of terms in our in our industry. So she coined things like register and bit and break point and a bunch of other words like that that we all know and love today.
Dan Shappir [00:26:17]:
So, again, how did you go about the research?
Uncle Bob Martin [00:26:21]:
I have got, like, a zillion books. And so it's all secondary research. You know, I didn't do any primary research. In some sense, you could look at we programmers bring book out. We programmers. You can look at that book as a a literature review, because I I read really significant books about Babbage and and about Grace Hopper and about all these guys. Right? And then I tried to condense them down and pull out two things. I wanted to pull out the human side of the story so that programmers who read this could identify the character flaws that they see in themselves, and these people are replete with character flaws.
Uncle Bob Martin [00:27:08]:
And then I also wanted to pull out the deep technology. That's something that most of these books do not go into. So I had to do that research myself. So when they're talking about when when they're talking about the UNIVAC one, they don't really go into much detail. So I've gotta pull all that information out and then describe, okay, programmers, this is what a UNIVAC one was like. This is how you program that. I actually put some UNIVAC one code in there. And I I talk about the, the the kind of code that Grace Hopper had to write in the in the late forties and early fifties to get the Harvard mark one to works.
Uncle Bob Martin [00:27:48]:
I wanted the programmers who read this book not only to identify with the human side of these guys, but also to identify with the deep technical problems that they were solving. So there's this really interesting juxtaposition. I think it's interesting anyway. Interesting juxtaposition of these these frail human people dealing with really difficult technical problems. Do you
Charles Max Wood [00:28:14]:
I I'd like you to go into more depth on one of these. You know, you mentioned, like, maybe the the UNIVAC or something else where, you know, it's just something that we don't even fathom, but they had to just figure out.
Uncle Bob Martin [00:28:28]:
Well, I mean, start with, start with the Harvard mark one. This was a a machine that was built by, Harold Aiken Harold Aiken kind of conceived of it in the navy. He was a navy guy, sort of get some popcorn. He he talked to the navy into building the thing. He actually talked to IBM into building the thing and then didn't give them any credit for it, which was a real problem for him later on. But his idea was to create this calculator, that could add, subtract, subtract, multiply, and divide, numbers that had 23 digits. I think that was the numbers. These numbers had 23 digits decimal.
Uncle Bob Martin [00:29:07]:
No. No. This wasn't binary. And the the digits were all held in these counter registers. And the counter registers could be addressed and moved into arithmetic units that could add I think it could add, three numbers per second if I remember correctly. And it could multiply and it and it could multiply in something under ten seconds. So fast by the day fast by the standards of the day, but impossibly slow from our point of view. This machine was programmed by punching holes in a 24 channel paper tape.
Uncle Bob Martin [00:29:50]:
And the 24 channels were broken up into eight zones, and the zones were, the register you wanna take the data from, the register you're going to to put the data in, and the operation you're going to perform on it. And those eight channels were all binary, sort of, sort of binary. The programmers programmed this by identifying what holes should have to be punched in that paper tape, and they did that numerically. So they would write their code as, four three six. I think I got that right. And four meant punch the fourth hole in zone one, punch the three hole in zone two, punch the six hole in zone three. That's how they would write their code. And if more than one hole had to be punched, they would write two two numbers in that zone area.
Uncle Bob Martin [00:30:50]:
Then they would come up with this program that was line by line by line, just these numbers, these three component numbers. And Grace Hopper is looking at this. She was like the third programmer in there and was was immediately turned into the the elite. She took over the whole thing. Had never seen a computer before in her life, had no idea what these machines were. Aiken threw her into the task and said, okay. For your first job, you have to compute the the arctangent coefficients to 23 decimal places. The interpolation coefficients for doing arctangents, in, 23 decimal places, which took her a week.
Uncle Bob Martin [00:31:30]:
And she had to figure out how the machine worked and how to punch the holes. And and, of course, she couldn't she didn't have dedicated time on the machine, so she had to steal the time, when the other guys weren't as busy as they usually are. And she managed to get that all done, and she worked all this out. And she realized and by the way, this is where the word code came from because they were writing codes. It was these numbers. So they called it codes, the computer codes. And she was one of the first person's people to say, well, each line ought to have a comment on it. So on the coding sheets that they had produced, you know, mim me a graph machine and they would, you know, crank out and produce these coding sheets, She put in a column for comments.
Uncle Bob Martin [00:32:15]:
First person to ever do anything like that. They, they began to learn as they were writing the programs for this thing. And the the kinds of programs they were writing were ballistic trajectories for artillery shells and, the timings of tides in various places, very deep mathematical problems. And as they did one after the next after the next, they started realizing that they were writing some of the same codes over and over again. And so they would take these little snippets that would do something, some task, some small mathematical task, and they would write them into their notebooks. And they called these transcriptions in their notebooks, subroutines. That was their name for them. And then they would share this back and forth.
Uncle Bob Martin [00:33:08]:
They would share their notebooks back and forth and eventually created a library of subroutines, which were just these handwritten documents in in a notebook style. And whenever they wanted to use one, they would go to the notebook, they'd look it up, and then they would transcribe manually those codes into their program. Of course, the register numbers had to change because one in one case, you might be using register three. In another case, you might be using register eight. And so when they wrote these in their book, they they used the convention that all registers were zero or based on zero, so they invented relocatable programming just out of sheer raw need. Eventually, the programmers would write the numbers, but they would hire people to do the punching. And then the the tape, the long tape, and these tapes got pretty long, the long tape would go back to the programmers, and the programmers would verify the holes against the code that they had written. There was no jump instruction.
Uncle Bob Martin [00:34:26]:
There was no way to do a loop unless you put the ends of the tape together, and then you could have a loop, and they actually did do that. I'm not sure that's where the word loop came from, but they did make loops of tape. But usually what happened was that there there was a halt instruction. There was an instruction that would stop the machine. And then on the tape itself, tape was fairly wide, 24 channels. Right? So on the tape itself, they would write instructions to the operator. If register three is less than 28, then go to and there would be a mark on the tape where they would back the tape up to and run it again. So all of the loops, all of the transfers of control were manual.
Uncle Bob Martin [00:35:11]:
They were they couldn't be done automatically, which means that the operators were always on call, always watching the machine, always repositioning the tape to try and get any kind of iterative process done correctly. That's just a glimpse of the horrors of the earliest of programming jobs.
Dan Shappir [00:35:35]:
One of my favorite characters that you also talk about, and I actually learned about him from, reading the book about the Manhattan Project when I was a kid, is John John von Neumann, who was an amazing intellect and person. His cape like, you you know, you watch a TV series like The Big Bag Theory, and everybody's kind of amazed by the capabilities of the Sheldon character. Well, think about somebody like that only doubled, but also highly social. Yes. He he was well known for his parties.
Uncle Bob Martin [00:36:13]:
Oh, yeah.
Dan Shappir [00:36:14]:
So there's so, for example, there's this famous story about him. He basically had, what a photo well, you don't say photographic memory. How do you call it these days?
Uncle Bob Martin [00:36:26]:
Photographic. Eudetic. You know?
Dan Shappir [00:36:28]:
Eudetic. Anyway, so a friend of, a friend of his, you know, tells a story where, you know, he he claimed to have this amazing memory. So to test him out, he asked him to recite the chapters of, Between Two Cities, which he read, like, when he was a youth. And he basically started reciting it, and he asked him to stop after something like ten or fifteen minutes.
Uncle Bob Martin [00:37:01]:
Yeah. That I I have seen that story, reproduced a few times in in slightly different context. But I think it's really clear that John von Neumann may have been the smartest person ever to have been born. And easily comparable to somebody like Einstein or, James Clerk Maxwell or someone like that. He he had this uncanny ability to switch disciplines and still be an expert. So he he was deeply involved with quantum mechanics in the early days. He was deeply involved with the the Manhattan Project. He was the only person on the Manhattan Project who was allowed to leave and come back and leave and come back at will.
Uncle Bob Martin [00:37:48]:
He could go anywhere he he needed to go because all the other parts of the military needed his advice. He was deeply involved with ballistics. He was deeply involved with with the shock waves of of explosions. He was he was running the computers at Manhattan on on the Manhattan project. He went out and looked at other ways of doing the computations. Didn't find a good one. Still stuck with the IBM punch card approach, but but, managed to get the initial, the initial models of the implosion of the of the plutonium core to work. The guy was, just a remarkable guy and and lucky as hell until the end of his life.
Uncle Bob Martin [00:38:32]:
Lucky as hell. Because he he managed to leave Germany A Year before it became impossible to leave Germany. He, joined the the Princeton Institute. Right? He was the guy who brought a lot of other guys over from Germany saying, hey. You know, it's nice over here in The US. You could come to Princeton. Oh, Einstein, come on over here. You know? People like that.
Uncle Bob Martin [00:38:53]:
So he was a massive recruiter. And like you said, it's it's unusual to find a guy who is supreme intellect, who has supreme intellect, and yet really good social skills. And he did. He was a social animal. So very Kind of like Feynman. Like Feynman. Yes. A lot like Feynman.
Dan Shappir [00:39:19]:
The funny thing about him, you talked about how some of these characters were kind of flawed, was that while he was such a great, amazing person and made so many contributions, he was also wrecked with self doubt. And he was, like, he felt that he did not he that he hadn't achieved as much as as his colleagues.
Uncle Bob Martin [00:39:41]:
What's the name of that syndrome? There's a it's that's got a name. I can't remember what the name of it is.
Charles Max Wood [00:39:45]:
Imposter syndrome?
Uncle Bob Martin [00:39:47]:
Kind of the other way around. Right? It's like,
Dan Shappir [00:39:53]:
he basically
Uncle Bob Martin [00:39:54]:
thought you've done enough. Right?
Dan Shappir [00:39:55]:
Yeah. He thought that he would, like you know, every obviously, everybody knew what Einstein would be remembered for and every and they knew what Hilbert would be remembered for, and he thought that he would not be remembered.
Uncle Bob Martin [00:40:07]:
Well, he was remembered and fondly.
Dan Shappir [00:40:11]:
Yeah.
Uncle Bob Martin [00:40:12]:
He was one of the inventors of Monte Carlo, the Monte Carlo method. And the story there is fascinating. They were trying to figure out, you know, how how to model, the the, diffusion of neutrons through a plutonium core. Right? How do you model it? How do you calculate that? And and, his buddy, whose name escapes me at the moment, his buddy sat down and said, well, how would you determine the probability of winning at solitaire? Now you could do that mathematically, or you could play a hundred games and count the number of ones that you won. And that was the beginning of Monte Carlo analysis, which which plays a huge role in the rest of the book. It drives the whole notion of Monte Carlo analysis drives nuclear physics for a good long time, but it also drives the creation of object oriented programming. It's it was Christian Nygaard's thing. He was a Monte Carlo analyst.
Uncle Bob Martin [00:41:13]:
And because of that, he started thinking about simulation and how to do simulation well. And, of course, then you bring in computers, and he wanted to create these the Monte Carlo compiler. And he recruited, he recruited his buddy, Ole Johan Dahl, and wrote this thing that they initially called the Monte Carlo compiler. It eventually became called Simula. And in the midst of all that, they literally invented object oriented programming.
Dan Shappir [00:41:43]:
And in the context of JavaScript, because this is JavaScript Jabber, I think Java JavaScript borrows from self, and as I recall, self borrows from similar.
Uncle Bob Martin [00:41:53]:
Yeah. Well, there's there's there's definitely something to that. The the story that I have heard, and I don't know that this is absolutely correct, but the story I've heard about JavaScript is that it was it was Brendan Ike's task to create a language that would run-in the browser. This is back in the Netscape scape days, the Mozilla days. And he wanted to make it lisp, but he didn't have time and there was self there and he kind of borrowed from that and cobbled together this thing called JavaScript. That may be an urban legend. I've I think I've seen that once or twice in various threads on the web. I don't know if that's true at all, but I think it's funny.
Charles Max Wood [00:42:32]:
If if you wanna hear the full deal from the horse's mouth, we have an episode where we had Brendan.
Uncle Bob Martin [00:42:38]:
Oh, with Brendan? I?
Dan Shappir [00:42:39]:
Yeah. Oh, beautiful. Yeah. Oh, beautiful. I I also conversed with him about this online even though I wasn't yet with the podcast when you recorded that episode with him. It's it's first of all, it's not exactly that. He was toying with the concept or the possibility of putting scheme in the browser, but it never really matured. And, yes, he did create and implement JavaScript in ten days, which are fondly known in the community as the ten days of glory.
Dan Shappir [00:43:11]:
But he said that JavaScript in a lot of ways is more influenced by, ARC than it is by Scheme.
Uncle Bob Martin [00:43:20]:
Like ARC?
Dan Shappir [00:43:23]:
For those of you who don't know, ARC is kind of like Pearl. Oh. It's a language for text processing.
Uncle Bob Martin [00:43:32]:
Ajo, somebody, and Kernaghan.
Dan Shappir [00:43:36]:
Correct.
Uncle Bob Martin [00:43:36]:
Who's the who's the w?
Dan Shappir [00:43:38]:
I forget.
Uncle Bob Martin [00:43:38]:
I can't remember who the w is.
Dan Shappir [00:43:40]:
It's one of those Remember? Unix utilities that you you can pipe stuff in and pipe stuff out.
Uncle Bob Martin [00:43:46]:
And The predecessor of Pearl. Yeah. Exactly. Predecessor of Ruby. Yep. The author is cool,
Charles Max Wood [00:43:53]:
actually. I I think it's a cool tool anyway.
Uncle Bob Martin [00:43:57]:
By the way, the very first Wiki ever put on on on the Internet was, couple of hundred lines of Pearl written by Ward Cunningham in, the very late nineties. Just, you know
Dan Shappir [00:44:11]:
Well, CGI scripts. You know? People people don't remember the origins of the web, but, the initial web servers were mostly done in Perl because people didn't wanna do all that text processing in c.
Charles Max Wood [00:44:25]:
Yep. So I have another question. I'm gonna change this topic a little bit because, you know, we talked about how computers were initially kind of these calculating machines. And if you go watch, like, the hidden figures movie. Right? They they have these women that are called computers and right? And their job was to do the math. Right? And then they got this fancy computer that would do the math. Right? And so then they were programming the computer. But when when did computers kinda go from this math machine to this sort of general purpose machine that we kinda think of as a computer today?
Uncle Bob Martin [00:45:00]:
That's a really interesting question, and there's two ways to look at that. You could look at it from a from the practical point of view. When did computers start doing more than just math? When did they really start doing more than just math? And and the guy who comes to mind there is Dijkstra because Dijkstra was the guy who was playing with, graph theory. He he came up with this this clever way of of computing the the best route to go from one city in Norway to another, something like that. And it was a demonstration. He wanted to show it show this demonstration to his, superiors. And he came up with this algorithm to do that. And that's a a very different kind of problem than, computing the, implosion wave in a plutonium core.
Uncle Bob Martin [00:45:52]:
So Right. So, that was a more practical one. So from that point of view, you could lay this at Dijkstra's door, and that would have been late fifties. Maybe the early sixties, but probably the late probably the mid fifties, actually. But it was Babbage in his con his his contemplations of his analytical engine, the thing that never got built, right, who started toying around with the idea that this machine that he had in his mind that had a thousand registers and a and a mill that could add, subtract, multiply, and divide, and an electromechanical no. Excuse me. A mechanical bus that could move numbers from registers to the mill and back again. Right? And was programmable by, punched pieces of wood.
Uncle Bob Martin [00:46:43]:
You know, Jacquard loom style. Right? These big chunks of wood with holes drilled in was how you would punish them. And and give it or even that's how you program them, punish them. Good word, Bob. That's how you would program them. And in the midst of just thinking about this machine, Babbage starts realizing that you could write a program for this machine that could play chess. He would he started working that out. Right? So in that sense, Babbage is the first guy to cross that boundary, to get out of the mathematical world and into the symbolic abstract world.
Uncle Bob Martin [00:47:25]:
And he had a number of other ideas like that. He actually put together a machine that could play tic tac toe. He actually built that one. Knots and crosses, although, you know, simple machine to build. Still, he was he was probably the guy that first had that concept.
Dan Shappir [00:47:43]:
That's amazing. I didn't consider that.
Uncle Bob Martin [00:47:45]:
Yeah.
Dan Shappir [00:47:50]:
There are several people that you decided not to include in your book. Few that come to mind are Donald Knuth or Church. You know, if you were looking more recently, maybe somebody like, Linus Trovaldis. So how did you decide to leave certain people out?
Uncle Bob Martin [00:48:14]:
Those are not conscious decisions. I did not have a list of people to leave out. What I did have was a hard cutoff date. I wanted to I wanted it to be a history book about other people, right through the late sixties into the early seventies. And then from that point, that's where part two of the book begins. Then it start starts to become autobiographical. From that point on, I can I can relate what was happening in the industry as an eyewitness, as a participant? So I shifted gears entirely and just started talking about my experiences, through the next thirty years. Thirty or forty, whatever it is.
Uncle Bob Martin [00:48:56]:
Some number of years. And I describe the industry from a, from an insider's point of view at that point. So the hard cutoff date was one of the reasons that you can't put that I didn't put, Linus in there, for example. People have complained a lot that I should have put Margaret Hamilton in there. Right? And I would have loved to. I actually bought a whole bunch of books on the Apollo program to read about that, but it turns out there's not a lot written deeply about the the stories there. Or or if there is, I missed them. So, you know, I went to look for that but didn't find it.
Uncle Bob Martin [00:49:35]:
Limited amount of time, I thought, okay. I can probably skip that one. There's a number of other people that I should have written about if I'd had the space like John McCarthy. I would have loved to have told an in-depth story of LISP. That would have been a great story to tell. Just, you know, ran out of time, ran out of of materials.
Dan Shappir [00:49:54]:
Engelbert and the mother of all demos.
Uncle Bob Martin [00:49:57]:
I'm sorry?
Dan Shappir [00:49:58]:
Engelbert and the mother of all demos.
Uncle Bob Martin [00:50:00]:
That's a story I don't know.
Dan Shappir [00:50:03]:
Check out the video for the mother of all demos. Basically, it's you can find it on YouTube. Let me do a quick search.
Uncle Bob Martin [00:50:12]:
The mother of all demos. Sounds good.
Dan Shappir [00:50:16]:
Yeah. It's still considered to be the greatest demo of all time.
Charles Max Wood [00:50:22]:
It's like I see a couple of them here. One of them is, like, an hour and forty minutes.
Dan Shappir [00:50:26]:
Yeah. It's pretty long. Basically basically, while everybody was doing punch cards so this this happened let me do I'm looking at Wikipedia. It happened in '68. So everybody was still doing punch card. This guy, comes along and well, guy. He was a professor. He does a demo.
Dan Shappir [00:50:47]:
I think he was a professor. A ninety minute demo, live demonstration, showing stuff like Windows, a mouse, drag and drop, copy paste, hyperlinks. 68.
Uncle Bob Martin [00:51:03]:
Yeah. Well, okay. It's where Alan Kaye got the idea.
Dan Shappir [00:51:08]:
It's pretty nuts. And he does this in this kind of deadpan voice, and, you know, he's wearing a suit and tie, and it's he's he didn't do it for, you know, it it it wasn't like a CEO talking up there. This is like, you know, academics talking about stuff. So it's it's but it's I I highly recommend for our listeners to or or for you, if you're not familiar with it, to go to YouTube and and just, you know, search for the mother of all demos and watch the video.
Uncle Bob Martin [00:51:42]:
Yeah. It's a video mainly.
Charles Max Wood [00:51:43]:
It's great.
Dan Shappir [00:51:51]:
So you said that the second half is kind of autobiographical. When did you enter the industry?
Uncle Bob Martin [00:52:00]:
I, I got my first job as a programmer at, age it was either 16 or 17. I can't remember exactly. And it was a summer job, and it was very temporary. And my father had actually gone to this company who was just a few miles down the road and had walked in there and said, you will hire my son. That was the kind of person my father was. And I found myself working at this place. And it was, like, two weeks two or three weeks that I was there, and I wrote a little bit of assembly language under the the, watchful eye of my supervisor. Got one little program working, and then he said, well, thank you very much, Bob, and now your time here is done.
Dan Shappir [00:52:42]:
When was that if I might ask?
Uncle Bob Martin [00:52:43]:
That was yeah. I was I think I was 16. That would have been I was born in '52, so I would have been 60 eight ish, something like that. I went back to that company, like, a year and a half later, and for a while, I operated offline printers, printing junk mail on third shift, and then, rapidly became a programmer. I think I spent about six months doing the offline printers, but knew some guys who were programmers and talked to them and convinced them that I probably could be could be writing code. And and from that point, I was writing a little bit of COBOL, which I hated. And then from then on, it was, mini computer assembly language, and a lot of it. So that was that's when I got my start.
Uncle Bob Martin [00:53:29]:
So I guess you'd have to say, really, my career began in the very, very early nineteen seventy, maybe late sixty nine.
Dan Shappir [00:53:41]:
And, oh, did you also go to university or college or or something
Uncle Bob Martin [00:53:46]:
like that? No. This is like the Vietnam War era, and the universities were all going nuts. And, my family wasn't really very well off. And in the meantime, I had devoured books on COBOL and PL one and Fortran and PDP eight assembly language. I was a real computer nerd. Still am.
Dan Shappir [00:54:07]:
So you're the original self taught developer?
Uncle Bob Martin [00:54:11]:
Well, probably not. One of them I mean, self taught. I think Grace Hopper was self taught. But but one of the But she did
Dan Shappir [00:54:20]:
come from academia, I believe.
Uncle Bob Martin [00:54:22]:
She did. Yeah. She was she was a mathematics professor. Yeah. At at, I can't think. Vassar? I can't remember.
Dan Shappir [00:54:29]:
Look. I I have to say that, you know, today, CS departments are departments on their own. But when I studied in the university, the CS department did not exist. It was part of the, the math department.
Uncle Bob Martin [00:54:44]:
Yeah. I mean It only came into existence
Dan Shappir [00:54:47]:
a couple of years later.
Charles Max Wood [00:54:49]:
Yeah. Sure. Anyway, you're gonna be the CS department.
Uncle Bob Martin [00:54:53]:
If you wanted to be a programmer in 1969, there weren't a lot of courses you could take, and access to computers was very difficult. And that was one of the problems that Kemeny was trying to solve. Kemeny was at, oh, jeez, one of the colleges out there. I can't remember where it is, on the East Coast. And, you know, access to computers was a really big problem. They eventually got time on, one of the computers at MIT, and, they would they would do it by schlepping punched cards, several miles. One of the guys would get on a train and and haul punch cards up there and run the jobs and then come back with listings. And so if you were a student, you would submit a program and maybe a week later, you got a listing.
Uncle Bob Martin [00:55:49]:
And Kemeny wanted to solve that problem. And he bought a little mini computer at it was a really dinky little thing, and and maybe he had six students that really learned how to do it very well. And then it occurred to him that he needed a bigger machine, and he and he wrangled General Electric to give him, for for a very, very low price, a couple of big honking GE machines. I actually worked on on a machine like that at about that time, at that at that same company, General General Electric, Datanet thirty. Really in really big in those days, big machines. And he and his buddy and a few, undergrads wrote in assembly language a time sharing system and a basic compiler in about six months and turned the student body loose. They had a whole bunch of teletypes that they just scattered around the the the the school, Dartmouth. They scattered around Dartmouth.
Uncle Bob Martin [00:57:00]:
And, the students could suddenly find themselves writing code and seeing it execute in the same session within minutes. And what did the students do? They wrote games.
Dan Shappir [00:57:16]:
Well, then you did bring up the fact that, that, Richie and Thompson and Richie created the Uniques and c because they wanted to play games. They wanted to
Uncle Bob Martin [00:57:29]:
play Space War.
Dan Shappir [00:57:33]:
Yeah. By the way, one of the things that I'm really sad about is I remember in the nineties or something, get a copy of the I triple e Spectrum magazine talking about the origins of the, video game industry, Atari and and whatnot. And, unfortunately, I did not keep it. And and, some crazy stories there as well. I mean, the the original Ataris had one k of RAM, which, you know, think about that the next time you're writing your five megabyte your your your 30 megabyte web application that does absolutely nothing. Or you play They they wrote Space Invaders in one k.
Uncle Bob Martin [00:58:12]:
You got a bunch of guys out there on the net going, okay, boomer.
Dan Shappir [00:58:18]:
I I I don't deny it.
Charles Max Wood [00:58:22]:
I remember playing games on the Atari. I mean, I was, like, six.
Dan Shappir [00:58:25]:
But Well, I can tell you a funny story is that it was the device was limited to four colors. And one of the games, they wanted to have eight colors. So they wanna have four different colors at the top and four different colors at the bottom. So what they did is they actually synchronized the game loop with the television refresh, and they would switch the palette of the colors mid screen. Oh, wow. So they that that way, they could get four different colors at, you know, the two halves of the upper part of the screen and the lower part of the screen.
Uncle Bob Martin [00:58:59]:
There was a lot of that kind of shenanigans going on.
AJ O'Neil [00:59:05]:
I love, video game podcasts, like and and the YouTube channels like Modern Vintage Gamer and, Video Game Historian doesn't really do much anymore, but the stuff that's there is great. I love learning about all those tricks that I think Modern Vintage Gamer just did one on. I think it was the Nintendo that does that, that that where they're doing that, where they're swapping on the chip. They're swapping what's being presented to the thing that's reading it in real time with a little microprocessor so that they can get two color palettes.
Dan Shappir [00:59:45]:
Yeah. They can't afford the garbage collection in the middle of their loop.
Uncle Bob Martin [00:59:52]:
It's all written in assembly language.
Dan Shappir [00:59:55]:
Alright. Well, I've got a few
Uncle Bob Martin [00:59:56]:
two is coming up in ten minutes.
Dan Shappir [00:59:58]:
So Yeah. Just as in in this interesting aside, we were talking we were mentioning Lisp. Lisp in the, I believe, fifties or sixties, I think, introduced the concept of garbage collection.
Uncle Bob Martin [01:00:08]:
Yeah. That's true. Yeah. Nygaard and and, Dahl, needed garbage collection in their in their, Monte Carlo compiler. And they tried to write their own, and then eventually, they bailed out and and borrowed McCarthy's, the concept of McCarthy's garbage collector. And that's what they put into Simula for a while.
Charles Max Wood [01:00:29]:
Alright. I'm gonna push this to fix because I've gotta go. I have I have a call in ten minutes.
Uncle Bob Martin [01:00:35]:
Okay. Alright.
Dan Shappir [01:00:36]:
I could talk history forever. I know. Right?
Uncle Bob Martin [01:00:41]:
I know. It's the it's the glory days.
Charles Max Wood [01:00:45]:
We'll get Bob back when, Clean Coaters comes out. We'll see if we can get him on Ruby Rogues and go into more of this stuff. But, yeah, let's do picks, and let's be fast because I want to be able to do them. So, AJ, you wanna start with the picks?
AJ O'Neil [01:01:00]:
Yeah. I'll just pick a short one. No. No. I can't do that. But The Expanse, I finished book two. And I just have to say so far between book one and book two, the book is like, the book and the TV show are very, very, very similar. Mhmm.
AJ O'Neil [01:01:20]:
If I were to describe the plot of them, they're pretty much identical. But the book is so much better because in the TV show, they cut out, like, critically important elements that are absolutely essential for you to understand why they transitioned from what seemed like two completely different TV shows with the same actors between season one and season two, where it's like, okay. These are not related other than it's the same people. There's, like, a few key pieces that if you know, it's like, oh, okay. Now I can have suspension of disbelief again. And then likewise, there's so much stuff that they added into the TV show that's completely irrelevant and just draws out like a couple extra episodes. Man. Yeah.
AJ O'Neil [01:02:06]:
So if if The Expanse didn't hit for you on the TV show, but you you like the first the first season, and and you wanna know where it goes, I I think I think the books are better. Chuck, you'll have to to chime in to, you know, if the is the ending satisfying after, what is it, six books or
Dan Shappir [01:02:25]:
nine books or something?
Charles Max Wood [01:02:26]:
But they don't they don't do all the books in the TV series. So just somewhere.
AJ O'Neil [01:02:32]:
They cut out pretty early.
Charles Max Wood [01:02:33]:
The the books are are very, very good, way better than the the TV shows. I had the benefit of having read the books before I watched the TV show. Also, fair warning, there's a little bit of a gap because the sci fi folks dropped the show, and then Amazon Prime picked it up. And so there was, like, a year where they didn't record. But, yeah, anyway, it's it the the TV show is terrific, but the books are and, yes, they still do stay pretty, pretty close to the books. So yeah.
Uncle Bob Martin [01:03:07]:
Yeah.
AJ O'Neil [01:03:07]:
So to keep things short, that's that's all I'll pick today is just got finished with that book, and I liked it. And I do have to say, Avalosara is worse in the book than in the TV show previously. I complained all she does in the TV show was come in, say the f word a couple of times, and leave. Yeah. She's the same in the book. Like Better
Charles Max Wood [01:03:28]:
in the as the books go on.
Dan Shappir [01:03:30]:
Okay.
Charles Max Wood [01:03:31]:
Dan, what are your picks?
Dan Shappir [01:03:33]:
Yeah. So I called dibs actually on this pick when it came along Fair. Because it's so great, and it's kind of related to some of the stuff we were talking about today. So it turns out that, this guy called Dimitri Mitropoulos, I hope I pronounce his name correctly, implemented the game Doom in the TypeScript type system. Because as we all know, the TypeScript type system is Turing complete. It's effectively a dialect of, Lisp, I think, in a certain way because you can implement loops with recursion, and you also do case, if statements, you know, along these lines. So he basically managed to implement something like, a compiler that that something that takes, I think, LLVM code and basically translates it into TypeScript types. It took him all of a year of working ten hour days to implement, and I think he has it running at something like a frame a week.
Dan Shappir [01:04:45]:
But it works, and it's the most insane thing I've ever seen. He put a video up. He said he'll put two more, one that he talks about, you know, he'll go into the details of how he actually implemented it, and I'm really trying to get him to come on the show.
Uncle Bob Martin [01:05:01]:
Oh.
Dan Shappir [01:05:01]:
If you're listening, please do. I've reached out to him, and I hope that I'll be successful. I you know? He did something like there's something like, a trillion types in in the code, something like that. He he had to remove all the limits out of the TypeScript compiler source
Charles Max Wood [01:05:20]:
code. Hope y'all.
Uncle Bob Martin [01:05:23]:
Okay. Wow. I wish I had copious amounts. Worthwhile project.
Dan Shappir [01:05:29]:
Yeah. You know, it's,
Charles Max Wood [01:05:30]:
It's gonna change humanity.
AJ O'Neil [01:05:32]:
This was very different from the the Floppy Bird implementation. Well Because Floppy Bird was a was an interpreter, and this is LLVM.
Dan Shappir [01:05:43]:
Yeah. Something wrong. If I understood correctly, like I said, we really need to get him on the show. But, you know, the the funny thing, though, it's we we talk about is is the fact that, yeah, the the type system in in certain programming languages, you know, TypeScript, also kind of c plus plus comes to mind. I think even Java to an extent is effectively a touring complete programming language in in and of its own because you can implement recursion, and with with halting conditions. So, yeah, it's pretty nuts. Anyway, you can't top that, and that would be my pick for today.
Charles Max Wood [01:06:21]:
I can't top that. I'm gonna throw out two picks really quick. I'm gonna do a card game. I've picked it before. I've picked it recently, but it's the one that I've been playing the most lately. It is the gang, and it's basically cooperative, Texas Hold'em poker. And so, what what you you all get dealt your pocket cards. You you do you know, you flip the river and the flip and the flop.
Charles Max Wood [01:06:47]:
Right? And, at each stage in the game, there are chips for each there's one for each player. You know, one up to however many there are. Whoever thinks they have the winning hand will grab the top one. Right? Sometimes you fight over the chips. And then, you know, you go around. And eventually, once you settle on the chips, then you do the flop or the the river. And you, you know, so you get three more cards and then right. And so then the the chips change hands because right now you have a pair or two pair or three of a kind or whatever.
Charles Max Wood [01:07:23]:
And, anyway, it's it's super fun. So, you know, it it takes about twenty minutes to play a game. I played it with four and five people. It gets a little harder when there are more people, but it's totally fun. So I'm gonna pick that. And then the other one is I've been watching the latest season of Reacher. I watch a lot of these kind of action kind of shows. I I really enjoy them.
Charles Max Wood [01:07:45]:
I have to say the plots aren't always that creative. Right?
Dan Shappir [01:07:49]:
They they
Charles Max Wood [01:07:50]:
have a lot of the same They're
Dan Shappir [01:07:51]:
not supposed to be.
Charles Max Wood [01:07:52]:
But, you know, I can just, you know, I can just sit and veg and turn my brain off. So, anyway, I'm enjoying that. They're, like, four episodes out now. So, reach her on Amazon Prime. Bob, what are your picks?
Uncle Bob Martin [01:08:05]:
In the spirit of ancient history, there are a couple of science fiction books that are worthy of a good solid read even though they're very old. The books that come to mind, they're a hundred years old, are when worlds collide and the sequel, after worlds collide. And don't don't get confused by, Velikovsky's worlds in collision. That's not the books that I'm talking about. When worlds collide and after worlds collide. Wonderful stories, written in the, I think, the nineteen twenties about, an astronomical collision with the planet Earth and the and the way the scientists of the age find a way to survive. But I won't go any further than that, except to say that it's very colorful and lovely and wonderful science fiction if you can tolerate the, glaring scientific errors that would have been obvious in the nineteen twenties.
Charles Max Wood [01:09:05]:
Awesome. Can can can you do spoilers after a hundred years? I I guess maybe you could. Anyway, Bob, if people wanna find you on the Internet or connect with you, where do they where do they find you?
Uncle Bob Martin [01:09:18]:
CleanCoater.com. That's my website. Cleanc0der.com. You can go there. Twitter handle is uncle Bob Martin. Beware. And, other than that, just around.
Charles Max Wood [01:09:34]:
Alright. Good deal. Well, thanks for coming, Bob. This was fun.
Uncle Bob Martin [01:09:37]:
My pleasure always.
Dan Shappir [01:09:38]:
This was awesome. Thank you so much.
Charles Max Wood [01:09:41]:
Alright. We're gonna wrap it up. Till next time, folks. Max out.

The Evolution of Clean Code and Software Legends with Uncle Bob Martin - JsJ_671
0:00
Playback Speed: