The Ancient, Strange Coding Language that 95% of ATMs Use

The Ancient, Strange Coding Language that 95% of ATMs Use

Half as Interesting

0:00 Identification division, program ID HAI557.

0:04 Procedure division, display Sorry, are you not following?

0:07 If not, don't blame yourself because that wasn't in English.

0:10 I was speaking COBOL, a computer language that almost nobody knows anymore,

0:14 but also underpins over 40% of online banking systems,

0:18 80% of in-person credit card transactions,

0:20 and 95% of ATM transactions to this day.

0:24 By one estimate, COBOL programs handle $3 trillion worth of transactions a day.

0:29 According to the MIT Technology Review,

0:31 the oldest verified currently running computer program in the world is in COBOL,

0:35 managing defense contracts for the United States Department of Defense, or war,

0:39 or the Trump Kennedy Center for the war arts,

0:40 or whatever we have to call these days.

0:42 If you've applied for federal student loans or filed for unemployment

0:45 during COVID in one of at least 12 US states,

0:48 that most likely got run through many of the 220

0:51 to 800 billion lines of COBOL code still in use these days.

0:55 And if the system kept running into problems while you tried to use it,

0:58 it may have been because there weren't enough COBOL engineers

1:01 on hand to help the system handle a huge influx in applications.

1:05 Yet, despite being so widely used,

1:06 this once populous coding language is now a skill so special that Indeed is

1:11 running ads making fun of how hard it is to find a COBOL engineer.

1:14 If coding languages were mythical creatures, COBOL would be a vampire.

1:18 It's somehow both immortal and dead,

1:20 and tends to suck the life out of people who get too close to it.

1:23 So, how did we get here?

1:24 Why do we still rely on it?

1:26 And if I drive a wooden stake through

1:27 a mainframe at the Department of Defense, will it die?

1:30 Today, I will try to answer two of those questions.

1:33 COBOL, or the Common Business Oriented Language,

1:35 dates back to the late '50s when this whole

1:37 computer thing was really starting to catch on.

1:40 Back then, most programming was done in languages made

1:42 by a particular mainframe's manufacturer to use on their mainframes.

1:46 So, unlike now, when you can jot down a few lines

1:49 in Java and run your code on whatever computer you wish,

1:52 programs in the late '50s were basically bespoke

1:54 to the machines they were made for, which is fine unless,

1:57 say, you want to update or change your hardware,

1:59 or write a program that involves multiple machines.

2:01 In 1959, people across the computer industry decided they'd like to have one

2:05 language that they could use on whatever

2:07 hardware or operating system they pleased.

2:10 And the United States Department of Defense was like, "That's a good idea.

2:13 We want in on that." And a year later, we had COBOL.

2:16 It didn't take long to catch on, in part because

2:18 the DoD mandated that any machine they bought had a COBOL compiler,

2:21 meaning that if you didn't get with the program,

2:23 literally, you were missing out on federal defense contracts.

2:26 And this was the Cold War.

2:27 The DoD was funding whatever, needles in space,

2:31 bombs to kill us all, COBOL, you name it.

2:33 So, naturally, everyone made their machines COBOL compatible

2:36 so they could stay on the DoD gravy train,

2:37 which I assume was literal and well-funded.

2:40 And pretty soon, COBOL was all over the government, the financial sector,

2:43 and basically anywhere else you'd find yourself churning through tons of data.

2:46 So, it's not that weird that COBOL was made,

2:48 and not even that weird that it became important.

2:51 What's weird is that it's still around.

2:53 After all, COBOL came out in the same decade as cassette tapes,

2:56 non-rotary phones, and ARPANET, all of which have been very updated.

3:01 And in some ways, COBOL has, too.

3:03 In academia and the development of new computery things,

3:06 modern languages have nearly totally replaced COBOL.

3:09 The trouble is, the systems written in it in the first place persist.

3:13 How paleolithic is COBOL?

3:14 Well, when I asked engineers whether they knew

3:16 anything about it for the sake of this video,

3:17 most responses boiled down to, "No, and I'm offended that you think I would.

3:21 How old do I look?" And then suddenly ordering $100

3:23 worth of anti-aging creams online and not answering my questions.

3:26 Though, for what it's worth, one guy did respond and mention that he

3:28 took one COBOL class decades ago and is still,

3:32 to this day, contacted for COBOL-related jobs, such is the shortage.

3:36 To someone familiar with modern coding languages, COBOL looks nuts.

3:40 Think of the difference between writing in COBOL versus something like Java

3:43 or Python is the difference between making something out of clay versus LEGO.

3:46 Both can certainly be done, but clay,

3:49 the modern language in this metaphor, will be more efficient,

3:52 and you can make the exact shape you want

3:53 because the thing itself is so adaptable to your needs.

3:56 Maybe you make a statue or a cereal bowl.

3:59 Whatever you want, it can make the shape.

4:00 And you can make the same stuff with LEGO,

4:02 but it'll involve more painstaking assembly

4:05 and will end up looking blocky because you're

4:06 building with pieces that are more rigidly defined than a bit of clay would be.

4:09 Point being, COBOL applications run just fine, but when you look at the code,

4:13 it looks completely different and many would say clunkier

4:16 and less efficient than an equivalent program in, say, Python.

4:19 Perhaps my favorite COBOL quirk is how important it

4:22 was to its creators that it read like plain English.

4:25 A line of COBOL code is called a sentence and has to end with a period.

4:28 While Java has 68 keywords, ones with a built-in meaning like if,

4:32 else, or return, COBOL has literally hundreds.

4:36 Anyone can see the difference.

4:37 In Java, the Hello World program looks like this, which,

4:40 if you know Java, is super straightforward, but if you don't, it's like,

4:43 "What on earth is public static void main?" This is the same thing in COBOL,

4:47 and you can probably guess what each sentence here is doing.

4:50 This is the title page.

4:51 The program is called Hello World.

4:52 This is where the magic happens.

4:54 This is telling the computer to display.

4:56 This is what's going to display.

4:57 And then we stop.

4:58 Remember, this language was designed for business and government-type folks.

5:02 They wanted it understandable in a way most computer stuff at the time was not.

5:05 So, they really buried the math.

5:07 In early COBOL, you'd do a sum by typing "add five to six." Eventually,

5:11 they added math symbols so you could

5:13 just say "compute five plus six," but still, that's legible English.

5:17 And this is relevant outside of straight-up math.

5:19 In Java, I could change a variable called name to Sam.

5:23 I can do it with this mathy notation.

5:25 In COBOL, I'd write the sentence "move Sam to name,"

5:28 like moving my name into the box labeled name.

5:31 How intuitive.

5:32 The trouble is, while COBOL is intuitive on a sentence level,

5:35 once you have millions of lines of the stuff,

5:37 it's nigh impossible to parse unless you built the system yourself.

5:41 Because every variable is global,

5:43 it's really easy to change one little line here and break the entire thing.

5:47 Because there's a statement called go to that has the program

5:50 jump to completely separate and sometimes hard to find part of code,

5:53 it's easy to get lost trying to read what the thing is doing.

5:56 Often programs written in COBOL are derided as being spaghetti code,

6:00 aka impossible to untangle and if I may add to the metaphor,

6:03 easily lost in the sauce.

6:05 Over the years, efforts were made to modernize COBOL and give it some

6:08 more of the moment features that make it a more versatile or efficient tool.

6:12 Trouble is, most of the relevant COBOL programs you can use

6:14 today were written before they did that, so it didn't help.

6:17 But for all its clunk, COBOL is genuinely good at processing large

6:21 amounts of data without screwing it up,

6:23 which is especially important in, you know, banking and the government.

6:27 So, no, most new things aren't written in COBOL, why should they be?

6:31 But the old things chug along.

6:33 But with precious few people learning it anymore,

6:35 there are fewer and fewer people alive,

6:37 let alone alive and not retired in Boca, who can maintain these systems.

6:41 In fact, a lot of COBOL maintenance is handled by a cabal of 600

6:44 cool old dudes who call themselves the COBOL

6:46 Cowboys and get called for COBOL emergencies,

6:49 which works, respectfully, for now.

6:52 But what about the future?

6:53 Well, we either need to start teaching COBOL

6:55 to people who don't remember 9/11 or start the extremely

6:58 expensive laborious process of rewriting these programs before we

7:01 find ourselves with no idea how the ATM works.

7:04 Well, I say we, but I won't be doing any of that.

7:08 Instead, I'll be watching Day Pass, a new show by Jason from Not Just Bikes

7:12 where he explores cities via their public transportation networks.

7:15 And I'll be watching it on this video's sponsor, Nebula.

7:18 Nebula is a creator-owned and operated

7:19 streaming service that's home to, among many,

7:22 many other things, original series like Day Pass,

7:25 early releases of new episodes of Jetlag: The Game and Tom Scott's England,

7:28 and of course, every Half as Interesting video, downloadable and ad-free.

7:32 It's the single best way to support me and the other creators on there.

7:35 Because, yes, I mean,

7:36 you get a cut of your subscription and blah blah blah blah blah,

7:38 but also it gives you exclusive access to our best, most ambitious work.

7:43 Work that's only possible through the support of Nebula's viewers.

7:46 So, if you want to get in on that, there's no time like the present.

7:49 Sign up using the link in the description

7:51 and you'll get half off an annual subscription,

7:53 meaning you pay just $30 for a whole year of Nebula.

7:57 So, go do that, check out Day Past, and I'll see you over there.

Study with Looplines Download Captions Watch on YouTube