1 00:00:01,270 --> 00:00:07,050 We'll come back in this lesson and continuing from our previous one we're going to talk about comments 2 00:00:07,100 --> 00:00:13,680 I'm in the process I'm going to explain some important aspects of how a compiler works. 3 00:00:13,940 --> 00:00:17,580 Let's go back to court in here. 4 00:00:17,600 --> 00:00:24,200 This is the app that all the projects have been working on and it only has a one file called the main 5 00:00:24,200 --> 00:00:25,200 that m. 6 00:00:25,310 --> 00:00:30,890 It's a little bit different than the dot and that you have in Iowa is projects that is connected to 7 00:00:30,890 --> 00:00:37,460 a dot h in here there's only one file and Devey that the wrong application works. 8 00:00:37,510 --> 00:00:42,610 We pressed the bill then run it goes through this file line by line. 9 00:00:42,620 --> 00:00:48,500 It goes from one line to another one to another one to another one it goes through the entire file and 10 00:00:48,610 --> 00:00:52,340 compares this whole thing to understand what it should do. 11 00:00:52,400 --> 00:01:00,130 That is essentially the role of a compiler not obviously obvious for earlier on about programming languages 12 00:01:00,140 --> 00:01:03,170 you can't just type whatever you like in here. 13 00:01:03,170 --> 00:01:07,470 It has to follow the rules of that particular programming language. 14 00:01:07,620 --> 00:01:14,930 However you can add comments if you just want to write something that is a note for you or if it's not 15 00:01:14,930 --> 00:01:18,050 for a colleague that you want them you want to pass on. 16 00:01:18,050 --> 00:01:24,980 So the way you're doing it is putting two forward slashes and this is a Carmens. 17 00:01:25,220 --> 00:01:30,080 Here you can write whatever you like. 18 00:01:30,860 --> 00:01:46,970 You can make the spelling mistakes and you can write about your code or something you remember. 19 00:01:47,300 --> 00:01:52,970 So for instance if I'm going along this code then I'm telling you that this and Aslaug is the code that 20 00:01:52,970 --> 00:01:54,270 helps us print. 21 00:01:54,290 --> 00:02:02,560 You can't just come in here and say this is the pre-install or if you want to you can just write here. 22 00:02:02,570 --> 00:02:05,300 I didn't quite get it. 23 00:02:05,540 --> 00:02:11,740 Let's review some parts I can type at some point. 24 00:02:11,960 --> 00:02:17,720 So it essentially is a way for you to write your own comments in real life examples and once you have 25 00:02:17,720 --> 00:02:23,420 a little bit more experience you obviously don't write this kind of comments you write comments for 26 00:02:23,420 --> 00:02:27,610 colleagues or people who might be reading your code down. 27 00:02:27,610 --> 00:02:28,180 That's right. 28 00:02:28,190 --> 00:02:33,340 Or things that you know you know that you have to revert back to them at some point. 29 00:02:33,350 --> 00:02:36,630 You might write something like that. 30 00:02:36,720 --> 00:02:50,210 It is not working properly review that Dox or you might write something such as this is the main preens 31 00:02:50,210 --> 00:02:58,100 method are reviewing it in what every class or something that makes sense to your colleagues. 32 00:02:58,100 --> 00:03:03,040 But for now you can write your own you know comments in here throughout your code. 33 00:03:03,110 --> 00:03:09,250 So when you go back to it it makes more sense for me however I'm going to remove everything that said 34 00:03:09,260 --> 00:03:11,390 comments. 35 00:03:11,390 --> 00:03:20,890 Obviously not that I should like and I'm going to remove all of these that line so I'm going to try 36 00:03:20,890 --> 00:03:26,860 to keep the quote minimal so it's not overwhelming for you guys but for you if you want you can write 37 00:03:26,860 --> 00:03:29,070 your own comments in here. 38 00:03:29,230 --> 00:03:38,120 So one way of writing comment was using two forward slashes comments Carmens the two watts slashes and 39 00:03:38,130 --> 00:03:44,520 there is another way if you want to write a longer piece of code and that is forward the slash the star 40 00:03:44,830 --> 00:03:47,940 and then you close it with a star for the slash. 41 00:03:48,010 --> 00:03:58,050 And here you can write multiple lines with many different things in them. 42 00:03:58,240 --> 00:04:02,620 So it will be entirely ignored by the compiler. 43 00:04:02,620 --> 00:04:09,910 So like I said when you press the bill down wrong the compiler goes in line by line by line but whenever 44 00:04:09,910 --> 00:04:17,480 it finds this sign to forego other slashes it completely ignores that line whenever it finds this line. 45 00:04:17,560 --> 00:04:24,730 It searches for the corresponding closing bracket and says let's ignore this entire piece and then move 46 00:04:24,770 --> 00:04:30,980 on to the next line and that's how the compiler essentially goes through your code and tries to interpret 47 00:04:31,000 --> 00:04:31,510 it. 48 00:04:31,660 --> 00:04:39,980 So whenever you want to put comments you can just go in here and say Here I want to say something and 49 00:04:40,000 --> 00:04:41,650 you can close it like this. 50 00:04:41,650 --> 00:04:45,530 Of course for one line it doesn't really make sense that we use this method. 51 00:04:45,550 --> 00:04:51,550 But if it was more than one line you could just add it like that and the compiler will know to ignore 52 00:04:51,550 --> 00:04:58,900 this while we are here and this isn't really as important but they have noticed people asking me how 53 00:04:58,900 --> 00:05:01,450 to show the line numbers. 54 00:05:01,600 --> 00:05:08,680 You go to Mexico to preferences in the Preferences you go to text anything on the very first thing up 55 00:05:08,770 --> 00:05:10,700 there is line numbers. 56 00:05:10,810 --> 00:05:17,890 So they exclude preferences text anything line numbers it will show you the number of the lines. 57 00:05:17,950 --> 00:05:24,310 Most usually you need to know the number of the lines but you know I kind of like to keep it in here. 58 00:05:24,640 --> 00:05:30,900 So with that in mind now that we know how to add comments to our call let's move on to our next lesson.