1 00:00:00,510 --> 00:00:04,620 Welcome back in this chapter, you are going to learn the basics of coddling. 2 00:00:04,800 --> 00:00:11,940 But before we go into that, we will check out the basic concepts of any old language and a copy of 3 00:00:11,940 --> 00:00:15,030 our sins for object oriented programming. 4 00:00:15,300 --> 00:00:21,690 And there are multiple different languages which are languages such as Java, C Sharp and, of course, 5 00:00:21,690 --> 00:00:22,140 Kotlin. 6 00:00:22,380 --> 00:00:23,880 There are plenty others as well. 7 00:00:24,450 --> 00:00:28,830 So the five basic concepts are verbs and types. 8 00:00:29,930 --> 00:00:38,150 Control flows, functions, collections and classes and hereby also objects, which of course, also 9 00:00:38,150 --> 00:00:39,110 includes inheritance. 10 00:00:39,350 --> 00:00:44,330 But generally, these are the five basic concepts, and you can find them in any object oriented programming 11 00:00:44,330 --> 00:00:44,780 language. 12 00:00:45,080 --> 00:00:47,770 And we're going to cover those throughout this chapter. 13 00:00:47,780 --> 00:00:52,760 We're going to dig deeper into every single one of those concepts with many different examples. 14 00:00:53,030 --> 00:00:56,600 And first of all, we are going to look at variables now. 15 00:00:56,600 --> 00:00:57,430 What are variables? 16 00:00:57,440 --> 00:01:00,590 Well, a variable is a location in memory. 17 00:01:00,860 --> 00:01:04,519 So when you create a variable, it's stored on your computer somewhere. 18 00:01:04,700 --> 00:01:10,010 And in order to indicate the storage area, each variable should be given a unique name. 19 00:01:10,160 --> 00:01:15,230 So once you create a variable, you have to give it a unique name, which is also called identifier. 20 00:01:15,560 --> 00:01:21,830 And you can access the data behind that point in the memory by using this name. 21 00:01:22,880 --> 00:01:27,710 Now, let's have a look at this so we can see here from Maine, which is the main function. 22 00:01:28,310 --> 00:01:29,590 Don't be confused by this. 23 00:01:29,600 --> 00:01:31,160 This is really just the entry point. 24 00:01:31,160 --> 00:01:38,150 If you create a codling application or Scotland program, then you have an entry point of your program 25 00:01:38,150 --> 00:01:40,130 and that is your main function. 26 00:01:40,140 --> 00:01:45,530 So this is just something that you will see every time when you create a Scotland program. 27 00:01:45,890 --> 00:01:52,880 So we have fun Maine, and then we use this keyword called VAR and then the name of the variable, which 28 00:01:52,880 --> 00:01:54,140 is called H in this case. 29 00:01:54,140 --> 00:01:55,670 And then we can assign a value. 30 00:01:55,670 --> 00:01:58,070 And in this case, I assign the value of 15. 31 00:01:58,070 --> 00:02:04,010 And if I print that now, it will print 15 print lines dense for print lines. 32 00:02:04,010 --> 00:02:09,889 So it's just going to print a line where it says 15, because that's the value of the variable that 33 00:02:09,889 --> 00:02:13,700 I passed to this function called print the line again. 34 00:02:13,820 --> 00:02:14,890 Don't be bothered by this. 35 00:02:14,900 --> 00:02:16,100 This is really just an overview. 36 00:02:16,100 --> 00:02:18,590 VIDEO We're going to dig deeper into this. 37 00:02:18,590 --> 00:02:23,330 Once we go into practice mode, then we have control flows and control flows. 38 00:02:23,330 --> 00:02:31,460 Allow us to do something conditionally, so only execute code if a certain condition is met and do stuff 39 00:02:31,460 --> 00:02:36,140 repeatedly so repeatedly run code as long as a condition is met. 40 00:02:36,500 --> 00:02:41,930 And this is very, very useful because there are multiple situations where you actually want to execute 41 00:02:41,930 --> 00:02:45,770 a certain code on to something multiple times. 42 00:02:46,070 --> 00:02:52,160 Here we have a quick example for a control flow so we can see we have a variable again called H and 43 00:02:52,190 --> 00:02:53,300 it's set a 17. 44 00:02:53,540 --> 00:03:02,720 And then the statement you may vote now will only be printed if the age is greater than 21 or equal 45 00:03:02,720 --> 00:03:03,290 twenty one. 46 00:03:03,620 --> 00:03:08,870 So this is the statement that we have here with the if key word and then in brackets the conditions. 47 00:03:08,870 --> 00:03:12,000 So if this condition is met, then execute the code. 48 00:03:12,020 --> 00:03:13,100 Otherwise, don't do it. 49 00:03:13,100 --> 00:03:19,460 And in this case, it will not execute the code because the age is not greater than twenty one and it's 50 00:03:19,460 --> 00:03:26,330 not equal twenty one, then we have functions and functions, enable us to separate code and to run 51 00:03:26,330 --> 00:03:27,770 CodeBlocks when needed. 52 00:03:28,040 --> 00:03:34,640 The cool thing is we can separate our code very easily with this and we can keep our code very clean. 53 00:03:35,000 --> 00:03:39,140 And this helps us to re use code a lot. 54 00:03:41,120 --> 00:03:43,370 So we don't have to type as much, which is great. 55 00:03:44,090 --> 00:03:49,730 So, for example, we have again our main function, which is the entry point of our program and then 56 00:03:50,510 --> 00:03:52,850 we call my function now what is my function? 57 00:03:53,180 --> 00:03:58,580 Well, my function is this function called my function that we created at the bottom here, which is 58 00:03:58,580 --> 00:04:04,280 just going to print a line which is going to say my function was called so nothing too fancy. 59 00:04:04,280 --> 00:04:08,760 And don't worry if you don't understand everything here, I'm not going to go into details in this video. 60 00:04:08,760 --> 00:04:14,360 It's really just to give you a very short overview of what you're going to learn in this chapter. 61 00:04:15,470 --> 00:04:21,519 We will, of course, see what all of those brackets mean and how to name functions and how to call 62 00:04:21,529 --> 00:04:24,020 function of what calling functions even means and so forth. 63 00:04:24,230 --> 00:04:27,860 So this is really just a short example of a function. 64 00:04:28,550 --> 00:04:34,700 Then we have collections and collections, enable us to store multiple elements in one place and iterate 65 00:04:34,700 --> 00:04:37,970 through multiple elements with the help of control flows. 66 00:04:38,000 --> 00:04:44,030 So if you want to store multiple values at one place, so to speak, so let's say you have a school 67 00:04:44,030 --> 00:04:50,720 class with all of the pupils in there or students, and you want to store all of their names at one 68 00:04:50,720 --> 00:04:53,090 place, then you would use a collection. 69 00:04:53,630 --> 00:04:57,710 Then we have classes and allow us to create our own data types. 70 00:04:58,280 --> 00:05:01,250 Keep the data members and methods together in one place. 71 00:05:01,910 --> 00:05:08,420 And this allows us to write more readable and maintainable code, which again helps us to work better 72 00:05:08,420 --> 00:05:13,040 in a team and to just keep working on our projects. 73 00:05:13,040 --> 00:05:17,720 Because the bigger the project gets, the more complicated it will get, and the more important it is 74 00:05:17,720 --> 00:05:21,530 that we keep things tidy and clean so that we still understand what we're doing. 75 00:05:21,740 --> 00:05:28,700 And a very important aspect of that is to use classes, and that's really the major idea of object oriented 76 00:05:28,700 --> 00:05:34,460 programming so that everything is a class to a certain degree, and we're going to see what that means 77 00:05:34,460 --> 00:05:38,270 in the future, because this is a very advanced concept, so to speak. 78 00:05:38,270 --> 00:05:42,530 So of course, it's still the basics, but it's rather advanced in comparison to the other stuff. 79 00:05:42,530 --> 00:05:47,630 So I really only want to dig deeper into classes once you understood all of the other things that we 80 00:05:47,630 --> 00:05:48,950 talked about in this video. 81 00:05:49,130 --> 00:05:52,400 So classes are going to be the ending portion of this chapter. 82 00:05:52,670 --> 00:05:59,030 So I hope this gave you a little overview of what we're going to learn and we're going to dig deeper 83 00:05:59,030 --> 00:06:00,650 into all of the topics now. 84 00:06:00,860 --> 00:06:04,190 So let's go to the next video where we start with variables.