 Professor Ranade is actually physically not here. He is currently visiting Ladakh with his family. Ordinarily, people visiting any corner of India can be logically with us. All that they have to do is they have to go to any one of our remote centers and thanks to the AVU technology that we are using, they can actually talk to all of us from wherever they are. He is actually to such a remote place within Ladakh that there is no remote center there and there is no internet connectivity. Therefore, I have decided to replay an exciting talk that he gave on this subject to all the coordinators of the workshop. They would be amongst you at each of the remote centers. Since that was such an important explanation from his point of view on how the programming course should be taught, particularly at the introductory level that I decided to use that lecture to benefit all of us in this main workshop. I'm going to speak about my views on how to teach introductory programming, my experience and what I have learned from it. Okay, let me begin with a very basic question. So what should you teach in an introductory programming course? So some simple answers are there, some obvious answers are there. You should teach the programming syntax. You should teach how to design programs. Is this all or is there more? Well, from time to time, we do need to ask more questions. For example, we should ask, programming has evolved for 50 years, has it changed during that period? And importantly, should that change be reflected in the way we teach? So you may have, it's clear to everyone that programming is becoming much more pervasive, okay, every device around you these days contains a computer, contains a processor, which has been programmed by somebody. Not only that, in many, many sciences, programming ideas are appearing, are becoming mainstream, they are becoming a part of that science itself. So for example, these days, biologists think a lot about computing. When it comes to evolution, when it comes to DNA, the whole field of computational biology, social phenomena are expressed. So computational ideas are becoming mainstream, not only in computer science, but even in subjects such as biology where people think of evolution as computation. Social phenomena, social networking is being analyzed at great length. Text understanding is a huge field. I mean, nobody can live without doing a Google search every day almost. The second important question is, are our students changing? After all, we don't teach in a vacuum, we have to have our students. And if they are, we have to figure out how they think and what they are doing. Over time, students have acquired a huge number of distractions. So half the time, students might be texting a message or something like that, so you have to guard against that. A few years ago, maybe 10, 15 years ago, engineering used to be a great career. It still is, but there are lots of distractions. Lots of people aspire to finance jobs or do IS and things like that. So what we should try to do is, we have to attract them. We have to attract them back. We have to make them feel that the subject matter of engineering and computer science and computer programming is really worthy of their study. Another point that seems to be emerging is that our students seem to be getting a shorter and shorter attention span. So we have to work hard to get the attention of the students in the first place. And having got that attention, we have to hold that attention for a certain duration if you want to tell them anything of substance. So what I'm going to propose are some strategic measures and then some tactical measures. So my first suggestion is that whenever we teach programming, we should take examples in programming from as many different domains as possible. Science, technology, even art. And the hope is that if we take all these different domains and take examples from all these different domains, quite possibly students might get more excited, or rather I should say, a greater fraction of students might feel that yes, there is something being taught over here which is of interest to me. Contrast this with the standard approach where most of our programming examples are drawn from text processing or simple numerical processing. This may not interest all students. For example, those who are not measuring in computer science may not like just this narrow set of applications. And of course, this course, Introduction to Programming is taught to all students of all engineering branches, so we have to cater to them also. The second point I want to make is that we have been mostly dealing with text input and output. I think it is high time that we went to graphical input and output. I mean, look, your students are carrying cell phones with touch screens, so they are doing graphical input. They are getting graphical output every day and it is a complete throwback to a bygone era if you ask them to work with just text. Also, if you allow graphical input and output, then a lot more interesting things can be done with a computer. In fact, I would contend that graphical input is almost essential and we really need to do something about it. We need to almost make it a standard part, like we have IO stream. Maybe we should have a graphic stream or something like that. So if you do all these things, I believe and I hope that we may be able to empower our students to do something more interesting and we may also be able to excite them. The second part that I want to talk about before I get into more specifics is that we also need to work hard to grab our students' attention. So how do we do that? So for grabbing attention, I think that we need to do a much, much more sincere job of trying to sell, just like a salesman sells his ideas or his goods, I think we need to make a more serious attempt at selling computer programming as an exciting and important activity. I state this because to most of us it is absolutely clear that computer programming is important and therefore we take it for granted that it should be clear to our students also. After all they are holding a camera or a phone in their hands which they know contains a computer. After all, when they came to your institutions, they probably booked tickets through IRCTC or something like that. So they have been using computers. Unfortunately, that does not register. We still have to tell them very, very clearly that look, this is how things get done. This is what you can do. So I think that selling job has to be done a lot more sincerely. I don't mean that we should spend an enormous amount of time on it, but I think a few very well chosen, maybe four or five well chosen slides or something like that will do the job. But believe me, students do not necessarily realize how important this course is and we have to tell them. One way of doing that and I think a very, very compelling way is to give them a demonstration of good programs, programs which they might themselves be able to write at the end of the course. Or you can tell them that look, maybe it is not possible that you will write this program at the end of this course, but maybe if you study this subject for two additional courses, then this is a program that you will be able to write. So that way, they can see that they can see for themselves where they can rise if in fact they work hard, if they take your course and things like that. So I will give some demonstrations at the end which will indicate what I think are exciting programs, which I think students will like. But I'm sure every one of you has your own tastes and your own experience with students for you to decide how you can reach out to your own students. As far as holding attention is concerned, that's also equally difficult and I will come to this point shortly. Again, the key point over here is that we have to arrange our material so that once we have got them excited, in my opinion, the way to keep them excited is to throw challenging problems at them. If we get them excited and then don't give them anything to work on, anything substantial to work on, that energy that we have created dissipates. Energy dissipates very, very fast. So we have to strike while the iron is hot. And the way to strike while the iron is hot in this case is to give them challenging programs which they would like to write for themselves. So the program should be such that having written those program, they will themselves get a kick out of it. It should not be the case that, look, I'm writing this program because Professor Ranade has asked me to do it. It is not that if I write this program, I will get good marks and therefore I will get a good grade, whatever. That is not the right reason. In my opinion, the right reason is you give them a program, they write it after when the program runs properly, they themselves see something thrilling, something exciting, something which gives them a feeling that, oh, I have accomplished something. So we have to throw assignments at them of this kind. And we can't let up on that. All right, so this is roughly the approach followed in the book. So I do discuss programming examples from different areas, math, engineering, art, operations, research. I don't teach anything new. I have tried not to teach anything new, but look, these are students who have done 10 plus 2 in science. So they know a lot of math already. They know a lot of physics already. And interestingly, throughout their 10 plus 2, they do not really get a chance to exercise their math knowledge. They learn a lot of math. What did they do with it? Essentially nothing. This is the place where they can put to use whatever they have learned. And believe me, students want to make use of things that they learn. So you have to give them a chance to make use of things that they learn. And they love it. That is my experience. To facilitate this, I have developed a teaching tool called Simple CPP. Simple CPP, in the main, contains a two-dimensional graphics library. It supports something called turtle graphics. Possibly several of you may know about turtle graphics. But anyway, I'll tell you shortly. It also contains support for fairly simple two-dimensional coordinate-based graphics. Again, two-dimensional coordinate geometry students have learned in 10 plus 2. So if you give them some problems of this kind, they are, in my experience, they are eager to do it because everybody likes to do things which somehow relate to things that they have done. So most people don't like to have compartmentalized knowledge. Most people want everything to be integrated. So if you give them a few problems, simple problems, not too hard. But problems where coordinate geometry gets used a little. And you'll see that I really mean very little. I'm not going to ask. I'm not going to expect them to know the equation of an ellipse or anything even that complicated. But simple coordinate geometry that they know, simple Euclidean geometry that they know, if they can put into action, I think that that satisfies a very, very primitive need that people have. So I have been sharpening my tools for 12 years. I have been only sharpening my tools. 12 years of school only develop tools. There is very little opportunity in the 12 years of school to use any of those tools. It's just learn, learn, learn, but no usage. Here is a course where people get to do things. People get to use the knowledge that they have acquired. And they can get a thrill out of it. And I think we should facilitate that. This two-dimensional graphics library that I'm going to talk about is extremely simple. I mean, I'm going to call it graphics library, but you should not really think of it as, look, he's proposing that we teach graphics in the first introductory course itself. That's not what it is. It's very simple, as you will see very shortly. In fact, one element of it is based on a language which was developed for children. We'll come to that. So in fact, I think that this kind of a library should become absolutely commonplace. It should become a part of programming languages to the extent that iostream is a part of programming languages. It also contains a couple of additional features. So there is a so-called new statement. Sorry, a statement I have included in simple CPD. A statement which is not there in C++. Don't get so worried about it. It's a very tiny inclusion. And the students have to do nothing in order to use this. So that statement is called main program. You will see it's a fairly trivial inclusion, but it accomplishes, it smooths some introductory hurdles. I have also included a statement called repeat. Again, this is a fairly simple statement. But again, it facilitates many, many problems that I will point out very shortly. And in the book, I have followed this general principle that if you want to teach something, you must have convincing examples. If you do not have convincing examples, no amount of lecturing, no amount of giving sermons is going to work. Examples are needed for the final understanding. And that, too, not artificial examples. If you can get reasonably real examples for any concept, object-oriented programming, recursion, if you can get vivid examples, that is what helps people understand. So the book has been written, or I have tried it at least. You have to tell me whether I have succeeded. I have tried to write the book so that I pose a problem if that problem typically cannot be solved by what students have learned until then. And then I introduce a new statement or a new feature. So here is a rough outline of my talk, the rest of my talk. So I'm going to spend some time talking about turtle graphics. Then I'll talk about coordinate graphics. Then I will spend some amount of time on recursion, because I think recursion is an extremely important part of introductory programming. It's a very simple concept, but it's perhaps the most important algorithm design tool. It's also perhaps the most non-trivial program design tool. And therefore, it is imperative, in my opinion, that our students understand recursion completely. And I would like to point out that by using graphics, it becomes very easy to understand recursion. And I'll give you some demonstrations about that. Then I'll talk about some other issues, some more standard issues. So I'll talk about maybe try to clarify what I think. What, in my opinion, is the difference between program design and algorithm design. I mean, after all, when you teach a programming course, there is always this thin line between when you assign a program. Is this an algorithm design program? Is the key part of this algorithm design, or is the key part of this program design? So that clarity is necessary. And I'll say something about how I have tried to make a distinction between the two. I will also talk about object oriented programming, the role of object oriented programming, and introductory programming. I'll talk a little bit about software engineering. I'll talk about standard libraries. I wanted to talk a little bit about history of programming. It's an important topic in some ways, but I don't know whether I'll get time. In any case, if you feel that is important, please ask me at the end. So I'll be happy to speak about it. Also, same thing about hardware. How much hardware do students need to understand when they are learning programming? So maybe if there are questions about that, I'll talk about it. So after that, I'll conclude, and I'll give some demos at the end. So turtle graphics is something invented in the 1960s by Seymour Pappert, who developed, who with other people developed a programming language called LOGO. LOGO is a programming language. It is, it is very active today even, but it was designed for teaching programming to children. So fourth standard, fifth standard, children. How many people have heard of LOGO? Great, so there are several. And anyway, I'll be explaining. So as you might know, or if you do not know, turtle geometry contains something in it called a turtle. A turtle is a symbolic animal that lives on the screen. So when you start turtle geometry, you get a screen and at the center of it, you get a small, typically red triangle, which represents a turtle. Now that turtle can be moved by giving commands through your program. So you can say, make the turtle go forward, let it turn, let it go forward again and things like that. The interesting thing is that the turtle has a pen, okay? So the pen drags along when the turtle moves. As a result, when the turtle moves, a line gets drawn. All right, so the turtle has a pen and as the turtle moves, the pen drags on the screen and therefore a line gets drawn. The goal of turtle graphics, or the goal when you write programs in turtle graphics, is to draw interesting pictures. We'll see examples of this very soon, but you may guess already what is coming. If you want to draw interesting pictures, you need to understand a little bit of geometry, depending upon how complex pictures you want to draw. Okay? Not only do you want to understand, you need to understand geometry, but you need to be able to take that understanding from one domain, which is geometry, and convert it into another domain, which is programming. So for whatever you want to do geometrically, you want to find what are the associated programming concepts that I want to use. This is a very fundamental activity and turtle graphics makes this activity very, very explicit. It's very obvious and very visible and therefore it helps in learning this activity. This activity is important, no matter what domain you are using. If you're writing a program to process salaries, there are constraints or there are relationships when you deal with salaries about interest, about taxes and all those things. Those relationships have to be understood and they have to be translated into the language of programming. This translation aspect has to happen over here as well and that is what makes this domain very interesting. The domain of geometry or the domain of this turtle is well understood. So that part is taken care of. So the children can focus entirely on this translation aspect. Okay, so let me give you a turtle program first. Then we will run this program also and then we'll run more complicated programs. Okay, so I'll invite you to stare at this just for half a minute and tell me at the end of it whether you understand what it is doing. Those who have seen turtle programming please do not respond. Those who have not seen turtle programming so far, I would like to hear from them. So anybody who has not seen turtle programming earlier would like to make a guess as to what this might be doing. Come again? Okay, so it is drawing a square? Okay, so it is indeed drawing a square and let me just go over, let me just make sure. So my principle is that when I'm teaching even if things are completely obvious, I at least give one line of explanation. So I will try to follow that over here as well. So the first statement, turtle sim, starts the turtle graphic simulator. So that will pop up a window on the screen. We'll do this in a minute. Then that turtle will be at the center of that window. Then forward 100 as you have guessed will command the turtle to move forward by 100 pixels. Then it says write 90. Okay, write 90 says to the turtle turn right by 90 degrees. Then next again there is a forward 100. So the turtle is over here. It says forward 100, then right 90. So the turtle turns, then again forward 100, right 90, forward 100, right 90, forward 100. Okay, so that's what the turtle has done. So the turtle has walked a square and as it has walked a square it has drawn a line. So the square has got drawn. So this is essentially the first program. So it can be discussed in the first lecture. It is, I do discuss it in the first lecture. Well, actually I don't discuss this program but I discuss a slightly modified version of it which I will show you in execution in a minute. The line at the top includes simple CPP says that look, we want the features from simple CPP included. Okay, now this also includes things like using namespace as steady include IO stream and things like that. The reason for this is that I don't really even want to talk about namespaces on the first day of classes. People don't even know what names are. So how can you even be talking about namespaces? You are just confusing and boring them. So we don't want to do any of this. IO stream, IO stream is a nice name but again, not really for the first day. Main program, main program is just a short form for the phrase int main program parenthesis. Again, I don't want to explain int, why int main? This is the first day. On the first day details like this should not be explained. What we should get to are the really interesting points. So I want to specify main program so I should be able to write main program and that should be the end of it. So then you see turtle sim is there as it was there in the last slide. Forward is there. Now I have put in weights over here. I have put in weight statements, wait for half a second. The reason for this, you may guess, is very simple. If I don't put it there, the whole thing happens so fast that you don't see, you don't get to see what is going on. So you have to slow down the computer a little bit so that it works along with you rather than just zooms ahead of you. That's all. Yeah, so as I said, I don't want students to even know that there exists something called namespaces, IO streams on day one. They have to understand it eventually but not on day one. On day one, they have to get something which is more interesting, more relevant and more at the core of the subject. Namespaces are not at the core of the subject. Programming is at the core of the subject and that is loops and that is how to translate things into programming language from your other domains. That's what is the core of the subject. Just in case people over here know what the C preprocessor is, this main program doesn't require you to do any additional compiling step or anything like that. There is something called a C preprocessor or the C++ preprocessor which I have defined just a small tiny macro in using the preprocessor and that macro gets expanded without any effort from you into int main. I'm just trying to hide this int business. I don't want to expose this namespaces and things like that but this is important because if I get to the real stuff very quickly then I can hold, I can get the students interested and then I can get to something interesting. I want to get to something interesting on D1 itself. Here is the second program for D1. Again, I would like you to take a look at it and tell me what you think it does. Forget that you are C++ teachers. Imagine that you are first year students and if you are looking at this then you have just been told about the previous program. So what do you think this will do? It will again do the square but now instead of writing out the commands forward 100, write 90 four times we are giving a directive which says repeat those commands four times. That's all. So what I have introduced is a so-called additional statement in C++. So this is the repeat statement that I have introduced. Again, this is just a very simple macro. But as you saw, even a school child can understand what this repeat means. It says repeat this statement, these statements several times, four times as it has been said over here. The right is used three times but here it's using four times. I'm really happy that you are observing that. So what the last program was doing was it was doing forward, right, forward, right, forward, and then it was doing a forward and it was ending at this point. So I'm facing in this direction now. According to this, I will turn right and I will stand over here. So I'm really happy that you are observing these details but as far as the drawing is concerned, the drawing is exactly the same. And from time to time, having drawn a square, you come back to your old position and I started facing in this direction after drawing everything and ending facing in this direction again. So that may be a desirable thing. So in that sense, this program is slightly better but the main point of this program is that I'm actually grouping and I'm not writing out everything four times but I just grouped the whole thing together. Yeah. So I think we can put weight also, right? Oh yeah, yeah, yeah. So in these braces, these braces are just like a regular old block. You can put as many statements inside as you want and you can put weight also. So it is exactly like a loop statement except that the C++ or C loop statements are complicated. Okay, you have to understand conditions. If you want to go with the for statement, you have to understand for int i equals zero semicolon. On the first day, students are going to be completely, I mean, they are going to get scared of that, right? So you don't want to do that on the first day. Okay, so on the first day, you want to say something simple. If the language doesn't have something simple, you can invent something simple. And this invention is not too expensive. This invention is fairly simple. Again, this is just a C++ pre-processor macro. Okay, so the simple CPP will load that macro in for you and it will happen effortlessly. The translation will happen effortlessly. I don't mean to say that students have to use this throughout their life but in the first few, first couple of weeks maybe, if they use it, they can do more interesting things and therefore their interest gets built up, okay? When you teach them for, which will happen maybe two weeks down the line, okay? Then obviously they can start using for, okay? Similarly, at some point, we'll talk about functions. At that point, we'll talk about what main me, what main is, what it means for a function to return an int and so on. So at that point, you should tell them that look, int main is what is the official way of writing a main program but that doesn't have to happen on day one. Okay, so the repeat statement is fairly simple. It says repeat so many times and whatever has to be repeated is specified in parenthesis, yeah. Sorry, after pre-processing, is there any facilities to see pure C++ statements? This is a macro, no? Yeah, this is a macro. After explanation of this macro, the output will be pure C statements, C++ statements. You want to see the C++ state by the result of generating this? Yes, yes, is there any facility in the C++? There probably is, I think, I don't know actually, I really don't know, okay? So have you seen the C++, the C pre-processor facility? No, that I don't know. Okay, but it's very simple. I mean, it is really simple. It's almost like you write a function call. You write, you define a function. It's almost a definition like that, okay? What you are doing is correct, sir. That is my doubt is, is there any facility to see the equivalence of C++ statements for this macro? Okay, I will, I can show you on paper, is that okay? All right. So it is something like, when you compile C program, it is going to create assembly language program. Yeah, but even before it gets to the assembly language program, whenever it sees this repeat, if a macro called repeat has been defined, then that repeat gets translated into something and only that gets compiled. Yes, yes. Okay, so for example, if I write repeat four and then say some x, x, x, okay? Then this will get translated to say for, say int and I will use some name. Okay, let me just call it i over here, but I can use some old name over here. That is correct, sir. i equals, sorry, i less than i equals int i equal to zero. Let me just write it again. For int i equals zero, i less than four. So this four is the one that comes over here. i++, okay, so this repeat part gets translated into this portion. Okay, sir. And this part. Fine, fine. Just gets put over here. It's fine, sir. Right, you have a question? Yeah, that is okay, sir. Okay. Great, thank you, sir. Thank you. Yeah, any other? So in this program, for the first day students, yeah, can something be done that we can exclude that inclusion of the hash include simple CPP? Because this is from my own experience that I'm saying, so when I taught just the simple program like the Hello World program. Yeah. So looking into the first statement hash include simple CPP, they asked me a lot of questions like why we are including this hash include, what is the meaning of this hash tag? I know, I know, but I mean, at least you should feel happy that now you only have one statement. Right? I mean, earlier you had to explain hash include IO stream. Yeah. Then you had to explain the namespace STD, using namespace, okay, using namespace STD. I mean, that is Latin and Greek, isn't it? But sir, in the first date, because very difficult to explain about the pre-processor directive. No, no, no, no, no, no. This I'm explaining to you. As teachers, I'm telling you what this, what this repeat statement is. You are not going to explain this to students on the first day, okay? When you teach the for statement, then you can say that repeat can actually be obtained, be translated into a for using a pre-processor. You are not going to reveal this magic to the students on the first day, okay? Thank you, sir. Would you please explain, so, okay, just repeat, act as a counter or suppose I want to print the value, just like a for loop and while loop. Is there an initial value and updation variable? Is there any facility in repeat? No, no. No, no. Okay. I must intervene. The moment we talk of repeat in the context of programming, automatically we think of a starting value, end value, increment, et cetera, et cetera. That is wrong. That is not how children perceive repeat. When you, just one second. When you tell people repeat something four times, they don't, they set a counter internally. They evaluate that counter internally. They don't look at the counter as a programming variable at all. And when we teach them for the first time, we don't want to talk about counter. We don't want to talk about initial value. We don't want to talk about final value. As Mr. Ranade said, all of these will come later. Okay. We'll have to teach a for loop later. Okay. We'll have to teach a while loop later. When we do that, at that time we introduce those notions. That's why I'm asking, sir. Yeah, yeah, yeah. Is there any facility, then I will do it. No, not right now. Right now there's nothing. Repeat this. You can say repeat n times where n is a variable. Okay, okay, sir. But that has to, whatever you write inside repeat has to result in a value. Okay, sir, okay. And that may need an integer value, obvious. Okay, sir. And that many times it will repeat. That is the purpose. That's the objective of this repeat. I think in later lectures I will get information. So just wait for one minute. You will see how you can get a counter also, but just wait. It will not happen on, it should not happen on day one. Okay, this is meant to be a bicycle. Okay, what you're asking for is a jet plane. Okay, I don't want to give a jet plane to a student on day one. I want to give a bicycle. Okay, yeah. Sir, a problem with us is that we already know the C, C plus plus, that is the problem. So we always think from a complex mind. We never think about a simple thing. Because when, yeah, what we have learned that when I started in a first year computer science, I had learned basic language. So I don't have any problem at that time also because it's a simple thing, just like a simple CPP. That's why we all are thinking from that angle. Whenever it comes repeat, we are having a comparison of for loop or repeat loop. Wonderful point. Let me just add one more thing. Now imagine how smart our students are that in spite of giving such a complicated introduction, they actually learn programming eventually. So my request now. Now try to imagine how easily they will learn more complex things. If the introduction is done in an extremely simple fashion to which they can relate to naturally and then they grow into the complexity. That's the whole point. Sir, that is okay. But now the CBSC and all the other IICB and all the other international boards and central board has introduced the C and C plus plus and Java in their course curriculum. So what happened when the students come to our colleges and they will ask the same kind of questions that we are asking right now. Because they already have that particular persona in the mind that how the C and C plus plus is working. I'll take this, I'll take this question before you. First and foremost, your statement is too generic. Even in IIT every year we get 30, 40 students who have not seen a computer in their life. And please remember we have to teach everybody. And in the initial days we must teach those people who have no introduction to computing. The people who have an introduction to computing may raise these questions. We simply ask them to hold and tell them that all the explanations will follow anyway. The entire course is surely about C, C plus plus programming not about that program. But he's discussing the most important articulation of the fundamental teaching paradigm. What to do in the first day, what to do on the second day, what to do on the third day? That's all. So you are very right, there will be several such people. And you are talking about universal things, no. The EDX 101 that IIT Bombay will be conducting for global participation. There are 23,000 registered people. And there are people from Europe who have not done any programming in their life. But they have seen a computer. There are people from Malaysia, I think Pakistan someplace, and Afghanistan, who are excited to learn something about computers. So don't forget there are people like that. And there are many such people in India. So what you say is right and they are not going to be disappointed. But all that you have to tell them is whole. You know all those things, don't relate it. So that is why we use the term simple CPP or turtle graphics. We are not talking about C, C plus plus. We are not talking about complex programming in the first few days. So the challenge in these programs is not really programming syntax. The challenge is figuring out what is happening in real life and translating it into programming syntax. Now that translation is very important. And my experience has been that even people who have learned C plus plus, have learned C plus plus and 10 plus two, have feel that challenge. So what you have to tell them is okay, you may know C plus plus, but do you know how to draw a square? Do you know how to draw this picture? I'll come to a complicated picture which was my first assignment when I taught this course. There is a very specific reason why I chose that picture. Many children had learned, many students had learned programming, logo programming in their fourth year. So the moment I said logo, they started looking bored. This guy is going to take us back to fourth standard. Why did I come to IIT to go back to fourth standard? That was the expression. Then I said, okay, fine, you know logo, but can you draw this? So I'll show you what this is and then they got put in their place. They would not be able to draw this and the skill required to draw that, which I'll show you in a minute, is the same for all students. So the challenge, there is the challenge for them. So we are in fact making a more level playing field because our challenge is we are saying that the language syntax is not the important part. What is important is taking real life description and translating it. This challenge, believe me, 10 plus two people think that they have learned programming. They have only learned syntax. They have not learned much more than programming, much more of the programming. So here is that same square program. So it is, as I said, it is waiting a little bit and it is drawing the square. Now, let me show you the program. I was going to delay it till the end, but I should show it right now since that question has been raised. So this is a program. This is a design that I want you to draw. This is what you might put on the border of a plate. Can you draw this? So all the people who have done logo programming in their fourth standard, fifth standard, 10th, eighth standard will look at this and say, yes, yes, there is something challenging over here. I would like to be able to draw this. So then if they say this, I'm happy. I have done my job. So this is the second program. This is a new statement. Here is another program for the first day. Again, take a look at this program and tell me what you think it might be drawing. So it is more complicated. Okay, pack of cards. Okay, that's great. Somebody has really the right answer. Okay, so what is happening? I'm starting over here looking in that direction. I draw one square and I come back and I'm pointing in that direction again. But now I'm going to turn right by 10 degrees and then I'm again going to draw the same thing. And now I'm pointing a little bit in that direction. Again, I'm going to turn by 10 degrees and again I'm going to draw this. By the way, the best way to think about turtle programming is to pretend that you are the turtle. That works. All right. So, okay, do I have to execute? Should I execute that program or? Yes, yes, yes. Yes, okay. Okay, so this is called cards in fact. Okay, so I'm sorry. I did not put in the wait statements in this. This has just gone, the turtle has just run through this very fast. But as you can see that the square has been rotated and it has gone up. Okay, all right. So that is roughly what I do on the first day. So what have they learned? They have learned control flow. They know that statements follow one after another. They know something about elementary iteration. Actually, they know a little bit more than elementary iteration because figuring out a nested repeat is not hard. Okay, the other point is that look, if you make a mistake, what is the worst thing that will happen? The turtle will draw something even more interesting, more intricate than what you wanted it to draw. Okay, so figuring it out will be a challenge, will be an interesting game. Okay, so my experience is that nested repeats are also easy to understand. Okay, so you have learned control flow. You have learned elementary iteration. You have understood the basic idea of syntax, spaces, indentation, things like that. We have to make a point to talk about that also. And the most important point is that you have got this idea that whatever you are doing you should observe the patterns. If you want to draw a square, you have to observe that the square is made up of four motions which are all similar. Do not write those four motions separately but put them into a repeat. If you wanted to draw a hundred sided polygon it would be foolish to have to write hundred statements forward turn, forward write. You have to put a repeat. Okay, so this is sort of a key programming idea. You have to observe patterns and you have to take those patterns and you have to translate them into a programming language. Okay, so the typical homework on day one is something like draw a chess board. So somebody was saying several squares, make it into a chess board. Again, nested repeats will do it. What is a circle? A circle is a polygon but where the number of sides is very large. It doesn't have to be infinity. It can be something like maybe 20 will be enough for most displays. You have to figure that out. How big is it that you need? Draw a five sided star. So this that we draw, draw that. So that's a nice geometrical challenge by how much do you need to turn? People figure that out. Okay, so students, I find that students are quite happy to do this because they actually see interesting things happening. Okay, how do you not lose? You have generated this excitement. You have to carry through the next lecture and so on. The trouble is that on the next day you probably have to explain how a computer works. Okay, then you have to explain what are data types and variables. Okay, in all this, this excitement that you have generated might seem to go down. Okay, so what do you do about that? Well, take this program. Again, stare at it for a minute and tell me what you think it might be doing. So it goes one step, it goes 10 steps and then turns, 10 steps and it turns. Sorry? It's doing a spiral. Okay, because subsequently, the length through which it is moving is increasing. Initially it was moving through 10 steps because I was one. Later on it starts moving through 20, then 30 and so on. So maybe we should see this. This is what it does. Sorry, I mean I have just let it zip through but you can guess that this is what it does. Now, you can have variations on this. You might want to have a circular spiral, made up of semicircles. So all those are interesting challenges. Again, the idea point is that taking some real life description and converting it into programming code. Okay, notice that in this, what we have done is we have reassigned a variable, i equal to i plus one. This is one of the difficult statements that many people have because it goes against what we learn in mathematics. But if you give them a program like this, this statement sort of becomes very, very visual. The effects of this become very visual and so it is easier to understand. That's my contention and hope. I will interrupt the interesting talk by Professor Abhiram Ranade at this juncture and we'll continue after the tea break. I would like to share with you the great accomplishments of Professor Abhiram Ranade. He was of course a brilliant student. I had the privilege incidentally of being his teacher. I also had the privilege of being the manager of the institute chess team in which he was a prominent member. But more than the chess player, he was a great academic. He subsequently did his PhD at Yale. He was a professor at Berkeley before some of us could manage to convince him to come back to India. He is one of the top 10 computer science researchers in the country and acknowledged as a great contributor to both theory and systems. The point is that his passion for teaching at the introductory level and therefore his own discovery of techniques which might be very effective are of immense value. You will notice that it is the book that is written by him which we have decided to use as a reference book. All of you would have got a copy by now, although of course it might be loaded on the machines back at your home. But for the limited purposes of this workshop, I have already uploaded the simple CPP related chapter on the Moodle. In the afternoon today, you will be doing a few experiments with simple CPP for which that will suffice. With this, I announce the tea break now.