 So, up until about a month ago, I was working as a postdoc at Drexel University. Unfortunately, I'm looking for a job right now. I was doing cool stuff like this at my job, tracking cells, that was all cool, but I wasn't always at Ivory Tower Academic. In fact, I spent the 90s working for a major television home shopping station. And while I was there, I was programming primarily in a language called COBOL. So anyone here use COBOL? A few people, maybe, not so many. So, I mean, we all have our ideas about COBOL. This is kind of what I thought I was getting into when I started programming COBOL, but it turns out, like, you can't really kill COBOL. So, if you go to the Micro Focus COBOL website, you'll find all these amazing statistics. They didn't have the exclamation points, but I added them because I think they really intended them to be there. And you can make a lot of money programming in COBOL as well. So, in fact, I've given a talk about some good things that I think programmers can learn from COBOL, but today I wanted to talk about some of the bad things about COBOL. I could take the easy way out and just say, like, it does tend to, COBOL programs do tend to be written to model the doodly appendages and so on, but that's that very interesting. So, I thought I would talk about an interesting bug I found. So, I was at QDC for about 10 years. This is towards the end of my tenure there that I found this bug. And of course, this isn't the exact program, but it's illustrating what the program was. And I thought I had seen everything I could see in COBOL. It's not a very complicated language, but this, I thought, was pretty interesting. So, even if you haven't seen COBOL before, it's pretty straightforward, I think. So, we've got some data declarations and we've got some business logic. So, business logic is pretty simple. If they're shipping by Federal Express, they should get the shipping date should be the next day, otherwise it should be two weeks from now. You know, this is 20 years ago. And then we have some other things. If the customer type is an employee or they're paying with a QVC credit card, then they get free shipping, otherwise everyone pays $4.99, okay? So, then at the bottom, we have these display things. That's how you print out values in COBOL. So, the expecting shipping date should be, well, it's not shipping from Federal Express, it's US mail, that's what US means. And so, it should be two weeks out. In fact, that's what it prints out. So, for the shipping charge, the customer type is an employee and so we think that the price should be zero, right? They should get free shipping. However, that's not what happened. In this case, the shipping was $4.99. Like, what the heck is going on here? Everything looks fine. And obviously, this is a serious production problem because the employees aren't getting the free shipping, right? So, we gotta look into this and see what's going on. So, one thing I didn't have at my disposal now that I have now, then that I have now is syntax highlighting editors. So, if you put that into a syntax highlight editor, like VI, it highlights that period there. Oh, so what's going on with that period? Who knows? So, there's some interesting, so there's actually two things going on with that period, but we have to go into some history to explain what's happening with that. So, this is Grace Hopper, of course. She's one of the creators of Cobalt. She's got this interesting quote that I found online. I'll read this out. Humans are allergic to change. They love to say, we've always done it this way. I try to fight that. That's why I have a clock on my wall that runs counterclockwise, right? Which is kind of a crazy thing when you think about the reputation that Cobalt has now. There's all this entrenched code sitting for 60 years in banks and things that people don't wanna get rid of, right? But for its time, Cobalt was a pretty radical language. It's created in 1959, so it's almost 60 years old, and it had two important design goals that are related to this bug. One was that it's got an English language syntax that we saw, right? It doesn't look like math. Like Fortran, other languages of time, looked a lot like math. This looks like English, right? And also, it's supposed to be business computing. So, reports and money. In fact, if you've used a computer to make a presentation, you're kind of, you know, yeah, in some way have Grace Hopper in her vision of computer programming to be things other than, like, misaltredectories and physics experiments, right? So, let's talk about this English language syntax and what's going on with that period. So, most languages, modern languages, have a kind of recursive syntax. So this is a bit of the syntax from C. And the thing I wanna point out is that we have statement up at the top, and statement can be a number of different things, including a selection statement, and the selection statement can have other statements inside of it. It can go in cursively, on and on and on. And this is so common that we kind of don't even think about it with languages nowadays. But COBOL does not work that way. COBOL has a hierarchical structure, in a particular, so we have program and divisions which we saw when I kind of brushed over and paragraphs and then sentences and statements. So, a statement is more or less what we're used to thinking of except that they can't be recursively defined. And a sentence is a group of state, one or more statements, terminating with a period. Okay? So some of you are starting to think about where I'm going with this. Okay, so I should also say, and part of the reason I was confused by this bug is that we had two different systems, COBOL systems and QVC. The one that I mostly worked on did if statements this way, where every time you had it, if you had to close it with an end if. So it's a little, so this is pretty familiar if you used to other languages. So it turned out I discovered actually just this week that this if end if was a relatively new thing that was added to COBOL only in like the mid 80s. So our other system did not support this. So they always had to use these periods. So without that, it gets very complicated to deal with like deskted if statements. So they had this thing called next sentence, which would break out of if statements. So to make sure that the if went with the, that else went with the first if and not the second if. And so this period is problematic for a number of reasons. One is that like they're very hard to see. They're only like for terminals at the time probably would only be a single pixel. And you know, if you've ever have tried to move code around in like Python where white space is important, it's even more of an issue with the period because it can break up control structures. Okay, so that's one thing this period is problematic. Secondly, this is what hard drive, this is what a five megabyte hard drive looked like in like the time that COBOL came out. So hard disk space was far too valuable to waste on computer programs. So programs were stored on things like this. This is a punch card. They've been used for everything from looms to the election and things like that. So how did these work? So there were a number of ways that data could be encoded but for a program, what would happen is that one card would represent one line of your program. There's 80 columns. So there's 80 characters that you could have in your program. All right. So then if you have, so that was one line. This is what an entire program would look like, right? So imagine what would happen if you dropped this, right? That would ruin your entire day. So what people would do is you'd reserve some of the columns at the beginning for a sequence number so that if you drop them, you could put them through a sorter and a mechanical sorter will put them back the way they should be, right? And then, okay, so what happens? You wanna have like subroutines and things. You can't repeat those numbers. So you'd reserve some other space at the end for some sort of a program ID and you could sort on that as well. And so here is a card for, this is from Fortran, but you can see here, this is the statement number five columns and there's eight columns at the end for an identification number. And this is for some other stuff, a continuation character. The scheme that COBOL used was even more complicated. But they had like different areas, area A and area B. And so in fact, we didn't use this either. We had, we always compiled in my system with a free flag. So it was free format. We didn't have to worry about any of this. But if you were in these constraints, you really only get 61 characters on every line for your actual code. Anything after that is just totally ignored. It's like a comment or white space. So this is what people coded in back then. You can see that this has those different divisions there. That doesn't even have anything after column 72. So anyway, you can kind of guess what the bug was at this point. So I lied a little bit. This is what the program really looked like. And this is kind of syntactic white space here. And so that period was in column 73, so it was ignored. So this, right, so it wasn't there. So this is really what the code looked like. So it was kind of over there. In fact, I knew some programmers who would tape a string, like a piece of thread between column 72 and column 73, so that wouldn't happen. What's next? Right, so my fix was to just move it over one line, and that's what fixed the program. So that's how I punch card ate my program. So thank you. Thank you.