1 00:00:00,150 --> 00:00:07,920 What is a programming language if someone asked you this question, can you answer it? 2 00:00:09,290 --> 00:00:16,880 Programming is simply a way for us to give instructions to computers, we give it an instruction manual 3 00:00:17,240 --> 00:00:23,210 and the computer follows without code, computer programs wouldn't do anything. 4 00:00:23,840 --> 00:00:27,320 You wouldn't be able to move the mouse around on your screen. 5 00:00:27,590 --> 00:00:29,450 You wouldn't be able to Google things. 6 00:00:29,690 --> 00:00:32,270 You wouldn't be able to play Pokemon on your phone. 7 00:00:32,720 --> 00:00:33,080 Right. 8 00:00:33,470 --> 00:00:36,020 I can't just tell my computer what to do. 9 00:00:36,920 --> 00:00:43,000 You see, computers don't understand English or any other human language for that matter. 10 00:00:43,580 --> 00:00:46,430 So what language do computers speak? 11 00:00:47,570 --> 00:00:51,680 Well, they speak in ones and zeros. 12 00:00:52,930 --> 00:00:59,380 All electronics speak that language of on or off, zero or one. 13 00:01:00,430 --> 00:01:07,050 But writing ones and zeros would be gibberish for us, it's hard for us to communicate like that, right? 14 00:01:07,780 --> 00:01:15,070 So humans have devolved programming languages that are in between human language and machine language 15 00:01:15,610 --> 00:01:23,160 that is zeros and one some programming languages are lower level than others. 16 00:01:23,170 --> 00:01:30,190 That is there closer to machine language and other programming languages are higher level than others 17 00:01:30,340 --> 00:01:35,470 that is there closer to English or a human language. 18 00:01:36,340 --> 00:01:43,390 And there are lots of programming languages, you have languages like assembly that is really, really 19 00:01:43,390 --> 00:01:44,400 close to machine code. 20 00:01:44,830 --> 00:01:50,620 You have languages like Python and JavaScript that are really, really close to English. 21 00:01:51,620 --> 00:01:57,570 OK, that's great, we have these pieces, but what are we missing here? 22 00:01:58,250 --> 00:02:05,280 I mean, if I want to find flights to Hawaii, how do we go from here to. 23 00:02:05,330 --> 00:02:12,050 Well, having, let's say, a website, show us a display of all our flights telling the computer to 24 00:02:12,050 --> 00:02:14,510 show those flight information on our screen. 25 00:02:16,020 --> 00:02:17,370 What are we missing here? 26 00:02:18,150 --> 00:02:26,220 Well, we have these programming languages that we usually write on a file such as Python, JavaScript, 27 00:02:26,220 --> 00:02:34,410 maybe even Java, and then we somehow need to get these files that we write into ones and zeros so that 28 00:02:34,410 --> 00:02:36,420 the our machines can understand. 29 00:02:37,570 --> 00:02:41,320 Well, we need a translator, right? 30 00:02:42,620 --> 00:02:50,750 We take our code that we write what we call a source code written in a programming languages, and we 31 00:02:50,750 --> 00:02:57,230 give that to a translator that can understand that language but also understands machine language. 32 00:02:58,070 --> 00:03:02,660 And this translator just translates these files for us. 33 00:03:03,660 --> 00:03:07,980 So what is this translator, it's not really a person, right? 34 00:03:08,010 --> 00:03:12,690 I'm not giving my code to somebody and somebody is going to just start shouting at the computer that 35 00:03:12,760 --> 00:03:13,800 be quite silly. 36 00:03:14,670 --> 00:03:18,990 What is this translator ready to have your mind blown? 37 00:03:19,470 --> 00:03:23,880 Well, it's another program written by a human. 38 00:03:25,580 --> 00:03:30,710 It can either be an interpreter or a compiler now. 39 00:03:31,540 --> 00:03:35,710 Python usually uses an interpreter usually. 40 00:03:36,950 --> 00:03:44,750 And an interpreter, just like a translator, goes line by line through our code and executes our code 41 00:03:45,050 --> 00:03:46,090 on our machine. 42 00:03:47,300 --> 00:03:50,150 Compilers are a little bit different. 43 00:03:50,660 --> 00:03:59,630 They take your code all at once with the entire file all at once and then translates that to machine. 44 00:04:00,380 --> 00:04:06,560 So again, interpretor goes line by line and each line executes an instruction. 45 00:04:06,830 --> 00:04:12,110 A compiler takes the entire file and turns it into machine code. 46 00:04:12,770 --> 00:04:19,150 Now, the differences between these two are a little complicated and beyond the scope of the course. 47 00:04:19,610 --> 00:04:22,190 And don't worry, we're going to come back to this topic. 48 00:04:22,340 --> 00:04:29,090 But I want you to just have this general picture that when we write code, whether it's Python, JavaScript, 49 00:04:29,090 --> 00:04:31,610 Java, C or C++. 50 00:04:32,650 --> 00:04:40,090 What we're doing is we're typing it in a language that is human readable, we're giving it to one of 51 00:04:40,090 --> 00:04:48,280 these translators like an interpreter or a compiler, and these spit out code that are able to run on 52 00:04:48,280 --> 00:04:48,910 our machines. 53 00:04:49,880 --> 00:04:57,950 So to review interpreters, translate line by line and execute the line before going to the next line, 54 00:04:58,250 --> 00:05:08,240 compilers translate all lines of a program to a file usually called a binary and execute the whole file 55 00:05:08,240 --> 00:05:08,750 at once. 56 00:05:09,880 --> 00:05:14,650 Now, in the next video, we're going to talk about this process a little bit more in detail, especially 57 00:05:14,890 --> 00:05:19,200 on how it works with Python, but why did I start with this? 58 00:05:19,210 --> 00:05:21,700 I mean, this is a complex topic. 59 00:05:21,970 --> 00:05:26,710 Most developers, especially if they're starting out, don't even know of this process. 60 00:05:26,740 --> 00:05:29,040 They just know that they write code and then it runs. 61 00:05:29,500 --> 00:05:31,900 So why did I teach this here? 62 00:05:32,590 --> 00:05:39,930 Because in order for us to be able to write Python code, well, I can't just write it anywhere. 63 00:05:40,330 --> 00:05:40,740 Right. 64 00:05:41,970 --> 00:05:47,310 If you went right now to your computer and let's say you opened up a text file like this one. 65 00:05:48,300 --> 00:05:53,790 And you started typing Python code, but for now we don't know Python, so let's just say I want to 66 00:05:53,820 --> 00:05:56,880 go search for Pokemon. 67 00:05:58,120 --> 00:06:04,380 Well, this might be code, we don't know if it is, but I can't just use this right. 68 00:06:04,510 --> 00:06:09,720 I mean, this isn't really python code, but how would my computer know what I'm talking about? 69 00:06:10,710 --> 00:06:17,700 In order for us to start writing Python, we need to download this translation service. 70 00:06:18,770 --> 00:06:21,140 And in the next video, I'm going to show you how to do that. 71 00:06:22,030 --> 00:06:22,870 I'll see in that one.