Every Programming Language Explained in 20 Minutes (Part 2) Just Explained https://www.youtube.com/watch?v=rQdgPLHE_cg Transkript (automatisch erstellt) 0:00 assembly. Before programmers had friendly words like print or add, coding was basically talking to a computer in numbers. Because early computers only 0:09 understood machine code, basically zeros and ones, the binary system, humans had to work almost directly with them. Imagine trying to code and you can only 0:17 use these zeros and ones for every instruction. And every code block looks like this. One wrong number and good luck finding the mistake. Assembly was 0:26 created to make this nightmare less terrible. Instead of memorizing a number for every instruction, programmers could use short words called pneummonics. If 0:34 you wanted the processor to add something, simply write add. Want to move data? Just write move. Then a program called an assembler translates 0:42 those commands into binary machine code, something the processor actually understands. And that's basically assembly's whole personality. You move 0:50 things around, tell the processor exactly what to do, and control everything at a ridiculously low level. It gives you incredible control, but it 0:58 also means that writing a simple Hello World program can feel like filling out government paperwork. It was developed by Kathleen Booth in 1947 while working 1:08 on some of the earliest computers at Burkebeck College in London. And here's a crazy little detail. She lived long enough to see smartphones, AI, and 1:16 modern computers become normal. She died in 2022 at the age of 100. Damn. I guess she did receive a lot of coders blessings. Before you start thinking 1:25 like, meh, what's so special about assembly? Let me tell you, a huge amount of the software behind the Apollo moon missions was written in assembly. So, 1:33 humans literally reached the moon using this programming language. But here's the weird part. Assembly isn't one universal language. Different processors 1:41 have different instruction sets. The processor in a PC and the processor in a phone both have different types of assembly. The basic idea is the same, 1:48 but the actual commands can be different. Today, nobody builds an entire modern app in assembly, but it is still used in everything from the code 1:56 that helps your PC boot to operating systems, car electronics, routers, and even the firmware inside tiny devices. One important thing before we move 2:05 ahead, guys, I've already covered a bunch of coding languages in part one of this series. [music] So, make sure to check that out after this one. Don't 2:12 worry, though, you can totally enjoy part two even if you haven't watched part one yet. Let's move on to the next one. Forran assembly made machine code 2:20 much easier to deal with, but you were still telling the computer almost every tiny step yourself. Move this number here, add that, store the answer there. 2:29 And in the 1950s, scientists basically looked at this and thought, I already know the maths. Why do I have to translate every little step into 2:37 computer instructions myself? That frustration led an IBM programmer named John Bakis and his team to build Forran, short for formula translation. Bakus 2:46 hated how much work programming took. He even joked later that a lot of his work came from being lazy. He simply wanted an easier way to write programs. And 2:55 Forran did exactly that. Instead of breaking a calculation into dozens of tiny computer instructions, scientists could write something much closer to an 3:04 actual mathematical formula. And a program called a compiler would translate it into machine code [music] for them. And the difference was 3:11 ridiculous. A problem that could take around 1,000 machine instructions could be reduced to just 47 forrand statements. This sounds completely 3:19 normal today. Back then, people genuinely thought it wouldn't work. Programmers believed automatically generated code could never be as fast as 3:27 code carefully written by an expert. Well, they would have lost their minds today if they saw what AI can do. Anyways, the 4R project was originally 3:36 supposed to take only 6 months, but it took nearly 3 years. But when Forran finally arrived in 1957, it worked so well that it completely changed 3:46 programming. Suddenly, scientists and engineers didn't need to become machine code experts just to use a computer. FORRAN exploded in fields like 3:54 engineering, physics, weather forecasting, spaceflight, and scientific research. NASA used it for flight calculations. And by the way, Forran is 4:02 older than NASA. So yeah, it is still used today for things like weather prediction, ocean simulations, and supercomputers. Cobalt. You might have 4:11 never coded in this language, but there's a good chance your last payroll ran on it. By the late 1950s, businesses were starting to use computers for 4:19 payroll, customer records, banking, and all the boring stuff that absolutely cannot go wrong. The problem was programming these systems was still a 4:29 mess. Different computer manufacturers had different machines. Programs weren't easy to move between them and most languages weren't really designed around 4:37 the kind of data businesses dealt with every day. So in 1959, representatives from computer companies and the US government actually met at the Pentagon 4:47 with an ambitious idea. What if all the businesses could use one common programming language? That language became Cobalt, common businessoriented 4:56 language. One of its biggest contributors was Grace Hopper, a programmer and US Navy officer who had already helped create Flomatic, a 5:04 language designed to make code look more like normal English. Cobalt followed the same idea. You could write something like add hours to total hours. And even 5:12 if you had never coded before, you could probably guess what it meant. But Cobalt was also built for handling huge amounts of business data. It could process 5:21 thousands of employee records, bank transactions, or insurance claims one after another. It even handled decimal numbers exactly, which is pretty useful 5:30 when those decimals are somebody's money. The funny part is even some of its creators thought it wouldn't last. Howard Bramberg, who worked on the 5:37 original Cobalt Committee, actually had a tombstone made for the language because he thought Cobalt was basically finished. That tombstone is now in a 5:45 museum. Cobalt is still running, and yes, people still code in it today. mostly maintaining and updating enormous banking and government systems built 5:54 decades ago. Basic. Back in the 1960s, computers used to be the size of a room. They cost more than a house, and learning to program wasn't exactly 6:04 something an average student could just try after class. [music] They were expensive, complicated, and mostly used by scientists, governments, and big 6:12 [music] companies. Two professors at Dartmouth College, John Kemin and Thomas Kurtz, wanted to change that. They believed students shouldn't have to be 6:21 computer experts just to use one. So in 1964 they created basic, short for beginners allpurpose symbolic instruction code. And the name pretty 6:32 much explains the whole idea. It was supposed to be simple enough for beginners to pick up quickly. The commands were short and readable. You 6:39 could type something like print hello, run it, and immediately see the computer respond. [music] That sounds completely normal now, but back then, making 6:48 programming this approachable was a pretty big deal. When personal computers started taking off in the 1970s and 80s, basic ended up everywhere. [music] 6:57 A lot of early home computers actually came with basic built-in. On some of them, you switched the computer on and basically landed straight into it. So 7:06 people would copy little programs from magazines, change a few lines, see what happened, break something, [music] fix it, and slowly learn how programming 7:14 worked. For an entire generation, BASIC became their first experience with coding. And here's something you didn't know. A teenager in the 70s got obsessed 7:23 with BASIC, dropped out of college, and used it to [music] build his first product. That teenager was Bill Gates. Basic was the very first thing Microsoft 7:32 ever sold. Pascal basic made it much easier for beginners to start programming. But as [music] computer science became a proper subject in 7:40 universities, teachers had another question. What's the best way to actually teach someone how to program well? And this was something Swiss 7:49 computer scientist Niklaus Vert cared a lot about. He felt that students shouldn't just learn enough commands to make a program work. they should learn 7:58 how to organize their logic, break a big problem into smaller pieces, and write code that someone else could actually follow. So in 1970, he created Pascal. 8:08 And unlike Basic, which was mainly designed to get beginners programming quickly, Pascal was deliberately designed around structured programming. 8:16 Instead of letting a program turn into one long chain of instructions, [music] Pascal encouraged you to divide it into clear sections and build the logic step 8:25 by step. Commands like go to, which could send the program jumping from one place to another, were exactly the kind of thing structured programming was 8:33 trying to rely on less. Basically, basic was great at getting you through the door. Pascal was more interested in teaching you what to do once you were 8:41 inside. SQL SQL is a bit of an odd one out compared to languages like basic, Pascal, or C. All of these are generalpurpose languages. It means you 8:51 use them to build whole programs, apps, games, whatever. But SQL can't build you an app or a game. It's got zero interest in that. It's like the guy at the party 9:00 who only wants to talk about one thing and one thing alone, databases. You see, by the 1970s, computers were getting very good at storing huge amounts of 9:09 information. Banks had customer records, companies had employee data, and airlines had reservation details. But actually finding something inside all 9:18 this data was very complicated. So researchers at IBM started working on a different idea. What if instead of telling the computer how to search 9:25 through the data step by step, you could simply tell it what you wanted. And that idea led to SQL. It stands for structured query language and it was 9:34 developed in the 1970s by Donald Chamberlain and Raymond Boyce. For example, if you wanted every customer from New York, you could write something 9:41 like select star from customers where city equals New York. It basically means show me all the customers whose city is New York. The database handles the 9:50 complicated searching in the background. And unlike a lot of languages from the 1970s, SQL never really disappeared. Even 50 years later, basically every 9:59 major system still runs on it. Your bank, Instagram, Amazon, your food delivery app, all of them are firing off SQL behind the scenes every time you tap 10:08 something. It just quietly became the language the entire world stores its information in, and nobody's managed to replace it. Pearl. Pearl is the language 10:16 that was everywhere in the '90s, then quietly slipped into the background. It was created by a guy named Larry Wall, who was actually a trained linguist 10:23 before he got into programming. And this detail is important because he built Pearl to work a bit like a human language. Messy, flexible, and with tons 10:31 of different ways to say the same thing. Pearl was ridiculously good at chewing through text. Log files, reports, huge, messy piles of data, you name it. if you 10:40 needed to rip through a mountain of text and pull out exactly what you wanted. Pearl did it faster and easier than anything else at the time. Now, you 10:47 might be thinking that SQL does the same thing. What makes Pearl different? And why did Shawn just call it the fastest and easiest of its time? Well, for SQL, 10:55 your data has to already be neat and organized, sitting in tidy tables inside a database. You ask it a clean question, it gives you a clean answer. Pearl is 11:04 the exact opposite. Pearl was built for the messy stuff that isn't organized at all. Let's say you have a million lines of raw website logs. Every single visit 11:12 dumped together with no order to it whatsoever. That data was never in a database, so SQL can't touch it. But Pearl, Pearl can tear through that 11:20 entire pile in seconds and pull out exactly what you want, like every visitor from Chicago who visited the website on a Tuesday. That was Pearl's 11:28 superpower. And this superpower made it the duct tape of the internet. When the early web was being built in the9s, a huge chunk of it was held together by 11:35 Pearl scripts quietly doing the boring work behind the scenes. Craigslist was built in Pearl and still runs on it. Early Amazon used a lot of Pearl. IMDb 11:44 ran on it and even Booking.com was heavily coded in Pearl. But that same flexibility became its problem. Pearl code could get so dense and cryptic that 11:52 even the person who wrote it couldn't read it a month later. People started jokingly calling it write once, read never. And when cleaner languages like 11:59 Python came along, offering the same power without the chaos, a lot of people just switched Lua. Most programming languages are designed to build the 12:08 whole program. But Lua was designed to sneak inside one. In 1993, a team at PUC Rio, a university in Brazil, was building software that needed to be 12:19 customized without rewriting the application every time. So, Robert Urusimchi, Luise Henrik Defiguredo, and Waldemar Celis created Lua. Damn, hu 12:30 Brazilians have pretty complicated names. Lua's whole point was to be tiny, fast, and easy to slip inside software already built in C or C++. Developers 12:41 would deliberately embed Lua right into their software code. So, if they wanted to change how something behaved, they didn't need to crack open the core code. 12:49 they could just edit a separate Luis script instead. This turned out to be incredibly useful for video games. A game engine can handle the heavy stuff, 12:57 graphics, physics, memory, while Lua scripts control things like what an enemy does, what happens when you press a button, or when an event should 13:05 trigger. And because Lua is small and easy to learn, developers can change those behaviors without rebuilding the engine. That's why Lua ended up inside 13:13 games like World of Warcraft and Angry Birds. Roblox also has a close connection to it. Roblox games now use Lua, a language derived from Lua 5.1. 13:23 Oh, and Lua means moon in Portuguese. One of the languages that helped inspire its creation was called Saul, which is Portuguese for sun. So, Lua, the new 13:33 language, got the opposite name. More than 30 years later, Lua is still actively developed and used in games, embedded systems, software tools, and 13:42 applications around the world, Ruby. By the early 1990s, programmers already had plenty of languages to choose [music] from. But Japanese programmer Yukihiro 13:51 Matsumoto, better known as Matts, asked a simple question. What if writing code could actually make programmers happy? Computers shouldn't be the only ones 14:00 comfortable reading the code. Programmers should enjoy writing it, too. And this led to the birth of Ruby in 1995. It was designed to read almost 14:09 like normal language. Instead of forcing programmers to write lots of complicated symbols and repetitive code, Matts wanted them to express an idea clearly 14:17 and let the language handle more of the boring stuff. Even the name has a fun story. Ruby was partly inspired by Pearl. So Matts wanted another gemstone 14:26 name and he eventually chose Ruby after [music] the birthstone of one of his colleagues. But there was something else that took Ruby from a beloved little 14:33 language to a global phenomenon. In 2004, [music] a developer built a tool on top of it called Ruby on Rails. And Rails was almost magic for its time. It 14:43 let a single person build a full working website ridiculously fast when the same thing used to take a whole team months. Suddenly, one founder in a bedroom could 14:53 launch a real product over a weekend. That kicked off an entire era. Twitter, Airbnb, GitHub, Shopify, all of them were originally built on Ruby on Rails. 15:04 It became the language of the startup boom. The thing you reached for when you had an idea and wanted it live, like yesterday. Oh, and true to its happy 15:12 roots, the Ruby community has an actual unofficial motto. Matts is nice, so we are nice. They literally built kindness into the culture, Swift. Around 2008, 15:25 Apple had a big problem. Developers were building iPhone and Mac apps mostly with Objective C, a language that had been around since the 1980s. It was powerful, 15:34 but Apple wanted something more modern, easier to read, safer to write, and still [music] fast enough for serious apps. So, in 2010, Apple engineer Chris 15:43 Latner quietly started working on a new programming language. For years, only a small group inside Apple knew about it. Then, at WWDC's Apple event in 2014, 15:53 [music] Apple finally revealed it to the world. >> What would it be like if we had Objective C without the baggage of C? 16:05 We did more than think about it. We have a new programming language. [cheering] [applause] 16:17 [applause] The language is called Swift and it totally rules. 16:25 >> Swift was designed to make common programming mistakes harder to make. For example, one of its big features is something called optionals. Basically, 16:33 if a piece of data might be missing, [music] Swift makes you deal with that possibility and fix it right there instead of just assuming it exists and 16:40 letting [music] the app crash later. But Apple also wanted the language to feel cleaner. Something simple like printing text could just be written as print 16:48 hello without a lot of extra code around it. Apple also knew it couldn't expect developers to rewrite years of existing Objective C apps overnight. So, Swift 16:57 was designed to work alongside Objective C, letting developers slowly add Swift to apps they had already built instead of starting from zero. Swift quickly 17:05 [music] became the preferred language for building apps across Apple's ecosystem, iPhone, iPad, Mac, Apple Watch, and Apple TV. Then, Apple did 17:14 something unusual for one of its major technologies. In 2015, it made Swift open source, meaning developers outside Apple could contribute to it and even 17:24 bring [music] it to other platforms like Linux. Today, Swift is still actively developed and remains one of the main languages behind modern Apple apps, 17:32 Cotlin. If Swift is the language for building on the iPhone, Cotlin is the one for the other side of the world, [music] Android. And for years, if you 17:40 wanted to build an Android app, you only had Java. Now, Java worked. It was rock solid. It still is. But it was also old and wordy. The kind of language where 17:49 saying something simple took a whole formal paragraph. You'd sit down to write hello and somehow stand up an hour later having typed an essay. So a 17:58 company called Jet Brains who [music] made tools for programmers got tired of it and built something better. They released Cotlin in 2011 and the pitch 18:05 was basically Java without the pain. Everything Java could do but cleaner, shorter, and far less annoying to write. Where Java made you write 10 lines, 18:14 Cotlin often did it in two or three. For a while it was just a nice little alternative that some developers quietly loved. Then the big moment came. In 18:23 2017, Google officially backed it and soon after named Cotlin the preferred language for building Android apps. That's about as close as programming 18:31 gets to a royal coronation. Practically overnight, the recommended way to build for a huge chunk of the world's phones was this cleaner, friendlier language, 18:40 and developers jumped ship without looking back. And the smartest part, the same move Swift pulled is that Cotlin gets along just fine with Java. Old Java 18:50 code and new Cotlin code can sit in the same project without a fight which almost never happens with two languages in one room. So nobody had to burn down 18:58 decades of work to switch. They just started writing the new stuff in Cotlin and left the old stuff alone. Oh, and Cotlin is named after a real island near 19:05 St. Petersburg, [music] which sounds random until you remember Java is also named after an island, the one in Indonesia where the coffee comes from. 19:13 So JetBrands basically named their language after an island as a quiet little wink, like a younger sibling going, "Yeah, [music] we're the next 19:20 Java. Don't worry about it.