1 00:00:00,150 --> 00:00:04,110 Instructor: What is a programming language? 2 00:00:04,110 --> 00:00:08,073 If someone asked you this question, can you answer it? 3 00:00:09,300 --> 00:00:11,700 Programming is simply a way for us 4 00:00:11,700 --> 00:00:14,760 to give instructions to computers. 5 00:00:14,760 --> 00:00:19,650 We give it an instruction manual, and the computer follows. 6 00:00:19,650 --> 00:00:23,850 Without code, computer programs wouldn't do anything. 7 00:00:23,850 --> 00:00:26,610 You wouldn't be able to move the mouse around 8 00:00:26,610 --> 00:00:27,600 on your screen. 9 00:00:27,600 --> 00:00:29,700 You wouldn't be able to Google things. 10 00:00:29,700 --> 00:00:33,510 You wouldn't be able to play Pokemon on your phone, right? 11 00:00:33,510 --> 00:00:36,900 I can't just tell my computer what to do. 12 00:00:36,900 --> 00:00:40,500 You see, computers don't understand English, 13 00:00:40,500 --> 00:00:43,590 or any other human language for that matter. 14 00:00:43,590 --> 00:00:46,563 So what language do computers speak? 15 00:00:47,580 --> 00:00:51,843 Well, they speak in ones and zeros. 16 00:00:52,950 --> 00:00:55,650 All electronics speak that language 17 00:00:55,650 --> 00:00:59,493 of on or off, zero or one. 18 00:01:00,420 --> 00:01:04,769 But writing ones and zeros would be gibberish for us. 19 00:01:04,769 --> 00:01:07,770 It's hard for us to communicate like that, right? 20 00:01:07,770 --> 00:01:10,860 So humans have developed programming languages 21 00:01:10,860 --> 00:01:15,600 that are in between human language and machine language, 22 00:01:15,600 --> 00:01:18,120 that is, zeros and one. 23 00:01:18,120 --> 00:01:23,120 Some programming languages are lower level than others, 24 00:01:23,160 --> 00:01:26,040 that is, they're closer to machine language. 25 00:01:26,040 --> 00:01:27,900 And other programming languages 26 00:01:27,900 --> 00:01:30,360 are higher level than others, 27 00:01:30,360 --> 00:01:35,360 that is, they're closer to English or a human language. 28 00:01:36,420 --> 00:01:39,840 And there are lots of programming languages. 29 00:01:39,840 --> 00:01:42,360 You have languages like Assembly 30 00:01:42,360 --> 00:01:44,850 that is really, really close to machine code. 31 00:01:44,850 --> 00:01:47,880 You have languages like Python and JavaScript 32 00:01:47,880 --> 00:01:50,763 that are really, really close to English. 33 00:01:51,660 --> 00:01:53,880 Okay, that's great. 34 00:01:53,880 --> 00:01:58,290 We have these pieces, but what are we missing here? 35 00:01:58,290 --> 00:02:01,740 I mean, if I wanna find flights to Hawaii, 36 00:02:01,740 --> 00:02:04,620 how do we go from here 37 00:02:04,620 --> 00:02:08,039 to, well, having, let's say, a website 38 00:02:08,039 --> 00:02:11,009 show us a display of all our flights, 39 00:02:11,009 --> 00:02:13,650 telling the computer to show those flight information 40 00:02:13,650 --> 00:02:14,613 on our screen. 41 00:02:16,050 --> 00:02:18,180 What are we missing here? 42 00:02:18,180 --> 00:02:21,270 Well, we have these programming languages 43 00:02:21,270 --> 00:02:24,030 that we usually write on a file 44 00:02:24,030 --> 00:02:27,390 such as Python, JavaScript, maybe even Java. 45 00:02:27,390 --> 00:02:31,800 And then, we somehow need to get these files that we write 46 00:02:31,800 --> 00:02:36,513 into ones and zero so that our machines can understand. 47 00:02:37,620 --> 00:02:41,463 Well, we need a translator, right? 48 00:02:42,600 --> 00:02:47,600 We take our code that we write, what we call a source code 49 00:02:47,700 --> 00:02:50,400 written in a programming languages, 50 00:02:50,400 --> 00:02:52,800 and we give that to a translator 51 00:02:52,800 --> 00:02:54,870 that can understand that language 52 00:02:54,870 --> 00:02:58,080 but also understands machine language. 53 00:02:58,080 --> 00:03:03,080 And this translator just translates these files for us. 54 00:03:03,660 --> 00:03:06,210 So what is this translator? 55 00:03:06,210 --> 00:03:07,980 It's not really a person, right? 56 00:03:07,980 --> 00:03:09,540 I'm not giving my code to somebody, 57 00:03:09,540 --> 00:03:12,450 and somebody's going to just start shouting at the computer. 58 00:03:12,450 --> 00:03:14,670 That'd be quite silly. 59 00:03:14,670 --> 00:03:16,980 What is this translator? 60 00:03:16,980 --> 00:03:19,500 Ready to have your mind blown? 61 00:03:19,500 --> 00:03:24,003 Well, it's another program written by a human. 62 00:03:25,590 --> 00:03:30,300 It can either be an interpreter or a compiler. 63 00:03:30,300 --> 00:03:35,300 Now, Python usually uses an interpreter, usually. 64 00:03:36,990 --> 00:03:40,020 And an interpreter, just like a translator, 65 00:03:40,020 --> 00:03:42,900 goes line by line through our code 66 00:03:42,900 --> 00:03:46,233 and executes our code on our machine. 67 00:03:47,310 --> 00:03:50,670 Compilers are a little bit different. 68 00:03:50,670 --> 00:03:53,700 They take your code all at once, 69 00:03:53,700 --> 00:03:56,400 reads the entire file all at once, 70 00:03:56,400 --> 00:04:00,390 and then translates that to machine code. 71 00:04:00,390 --> 00:04:04,050 So again, interpreter goes line by line, 72 00:04:04,050 --> 00:04:06,870 and each line executes an instruction. 73 00:04:06,870 --> 00:04:09,780 A compilers takes the entire file 74 00:04:09,780 --> 00:04:12,750 and turns it into machine code. 75 00:04:12,750 --> 00:04:15,960 Now, the differences between these two 76 00:04:15,960 --> 00:04:19,680 are a little complicated and beyond the scope of the course. 77 00:04:19,680 --> 00:04:22,380 And don't worry, we're gonna come back to this topic. 78 00:04:22,380 --> 00:04:25,410 But I want you to just have this general picture, 79 00:04:25,410 --> 00:04:26,760 that when we write code, 80 00:04:26,760 --> 00:04:31,760 whether it's Python, JavaScript, Java, C or C++, 81 00:04:32,640 --> 00:04:34,830 what we're doing is we're typing it 82 00:04:34,830 --> 00:04:37,770 in a language that is human-readable, 83 00:04:37,770 --> 00:04:41,700 we're giving it to one of these translators, 84 00:04:41,700 --> 00:04:46,470 like an interpreter or a compiler, and these spit out code 85 00:04:46,470 --> 00:04:49,890 that are able to run on our machines. 86 00:04:49,890 --> 00:04:54,300 So to review, interpreters translate line by line 87 00:04:54,300 --> 00:04:58,260 and execute the line before going to the next line. 88 00:04:58,260 --> 00:05:02,370 Compilers translate all lines of a program 89 00:05:02,370 --> 00:05:06,300 to a file usually called a binary, 90 00:05:06,300 --> 00:05:08,913 and execute the whole file at once. 91 00:05:09,930 --> 00:05:11,100 Now, in the next video, 92 00:05:11,100 --> 00:05:12,600 we're going to talk about this process 93 00:05:12,600 --> 00:05:13,950 a little bit more in detail, 94 00:05:13,950 --> 00:05:17,250 especially on how it works with Python. 95 00:05:17,250 --> 00:05:19,170 But why did I start with this? 96 00:05:19,170 --> 00:05:21,960 I mean, this is a complex topic. 97 00:05:21,960 --> 00:05:24,870 Most developers, especially if they're starting out, 98 00:05:24,870 --> 00:05:26,730 don't even know of this process. 99 00:05:26,730 --> 00:05:29,520 They just know that they write code and then it runs. 100 00:05:29,520 --> 00:05:32,580 So why did I teach this here? 101 00:05:32,580 --> 00:05:37,350 Because in order for us to be able to write Python code, 102 00:05:37,350 --> 00:05:40,863 well, I can't just write it anywhere, right? 103 00:05:42,000 --> 00:05:44,340 If you ran right now to your computer 104 00:05:44,340 --> 00:05:47,350 and let's say you opened up a text file like this one 105 00:05:48,330 --> 00:05:50,760 and you started typing Python code, 106 00:05:50,760 --> 00:05:52,260 but for now, we don't know Python, 107 00:05:52,260 --> 00:05:57,003 so let's just say I wanna go search for Pokemon. 108 00:05:58,170 --> 00:06:01,470 Well, this might be code, we don't know if it is, 109 00:06:01,470 --> 00:06:04,530 but I can't just use this, right? 110 00:06:04,530 --> 00:06:06,870 I mean, this isn't really Python code, 111 00:06:06,870 --> 00:06:09,843 but how would my computer know what I'm talking about? 112 00:06:10,740 --> 00:06:14,010 In order for us to start writing Python, 113 00:06:14,010 --> 00:06:17,883 we need to download this translation service. 114 00:06:18,810 --> 00:06:22,050 And in the next video, I'm gonna show you how to do that. 115 00:06:22,050 --> 00:06:23,477 I'll see you in that one. 116 00:06:23,477 --> 00:06:24,310 Bye-bye.