 So as Professor Fatik said, I recently taught this course. And this is really going to be a bit of a personal account of what I did. So as has been said, there were 700 students, 60 teaching assistants, and for some strange reason, it seemed that we didn't really have a good textbook. But anyway, I'm not going to talk about much of that. I'm going to talk about sort of the usual aspects of teaching, what should be the content and how should it be delivered. And I should clarify that this is my personal experience. And if you want to get anything out of it, you will have to customize it to your own personality. So some background to this or how I thought about all of this. So I feel that in the last 15, 20 years, students have changed quite a bit. And we need to really take that into account. So I'll talk about that. Then I'll talk about what are my own personal but not really original premises about learning. I feel that learning should be a lot of fun. And motivation plays a very important role in it. And there were some very specific themes that came up in the course that I developed. So they included some level of graphics, some idea on how to deliver every single lecture. So some idea about how the format of each lecture should be, specifically starting of each lecture with a problem to be solved. We'll come to that. There is sort of a feeling, and this is fostered in textbooks in schools, that it's OK to introduce subjects. So in chapter in say seven standard, we introduce fractions. We don't really do anything interesting with them. In eight standard, we do something interesting with them. I don't think that works. I think if you want students to learn something, some level of depth is really important. Otherwise, people just forget. Otherwise, it is just information. You have to do something with the ideas in order for that idea to really sink in. And I think that in any course, there should be excitement, something which students can be really surprised about. And students should find fun. And then I'll conclude. So here is what I think the new student looks like. 20 years ago, students were far more reverent. Students respected their teachers and parents a lot more. It's not that they don't respect today, but somehow they don't really trust. So if I tell my son that, hey, look, you should study this, he's going to ask me why. And we have to answer those questions. I think these days, all of us probably oppress our children a lot more than parents used to oppress their children 20 years ago. Very unfortunate, but that's true. So by the time students come to college, I think they are tired. They think that, look, at least now I should do something that I like. So students really want to know why they should be learning. And students also have a large number of distractions around. So there is TV, there are video games. So you have to be competing for their attention. So here are my basic ideas about learning. I think the first and the most important thing perhaps, which I think is missed quite often, is that the motivation for studying anything must be very, very clear. And by that, I mean not that you just articulate it and you state it very clearly, but somehow you have to persuade the student that he or she should really feel as connected to the topic as you perhaps might feel. So the student must really want to do that learning. For this, perhaps we should have topics that must be fun. Or if there are topics which are stressing more on utility, then we should say, look, this is really supposed to be beautiful. This is really supposed to be fun. But really, we should be teaching things which are both beautiful and which have utility. So I'm going to be dwelling on this aspect of fun, because I really think it is important. I think we really, at every level, we really must try very hard to make learning fun. So perhaps a short set of bullets on what is fun. Eating ice cream is fun, of course. Climbing a mountain is fun. Swimming or playing a sport is fun. Seeing a movie or seeing sort of a grand panorama from the top of a mountain is fun. Seeing a magic show is a lot of fun. And I feel that learning should have something like this over the course, over the duration of the entire course. Of course, I don't mean that you should actually have a magic show in your classroom, but there should be some element of magic coming up. As far as programming is concerned, there are a few additional things. Say for example, students should feel some kind of a sense of accomplishment. And of course, you could say that now, after I have taught this course, this student is able to solve force-order differential equations. That might be very exciting to you, but perhaps for the student, the student is just doing it just to pass that exam. I have done that. I have done that in this very institute. And I have passed the exam with flying colors. And today, if you ask me what was that course about, I have no recollection or I have very little recollection. So what we should really be aiming for is that students should accomplish something, which is really significant for their own liking. They should really want to accomplish. And that's where we should be helping them. There should be a bigger picture, say for example, computer science should be related to other sciences, other engineering, maybe humanities. And as I said, there should be an element of magic. Once in a while, the student should say, wow, that was really interesting. I don't know how you thought of that, something like that. Of course, it doesn't mean that the teacher has to think of everything, but the teacher has to pull out such interesting nuggets and show them to the student. So with this set of assumptions, I tried to develop this course. And perhaps the most important theme in this course was this theme of using graphics. So on day one, students had available a graphics library. If people here have seen this, there is some really exciting material on teaching programming to children. So Seymour Papert, currently at MIT I think, and a large following of his, have developed this notion of turtle geometry. Has anybody seen this? Anybody seen turtle geometry? If you have not, I would really strongly recommend looking at it. So one of the major ideas in this turtle geometry, it sits by the way, it's available in open source in all kinds of ways. Just go to the net and search for turtle geometry and you will get it. If you have a child five or in standard fifth or something, your child will love it. But of course, if you have older students, they will also love it. Students in my class also very much like this idea. So it's kind of a universal appeal. So what is this turtle geometry about? Well, you get a graphic screen. And on the graphic screen, there is a small triangle which represents a turtle. And then you are going to write programs which will drive that turtle around on the screen. So you can say forward 10. So the turtle moves forward by 10. But the turtle also has a pen attached to it. So as it moves forward, so say forward is going up. It's pointing upwards. As it moves forward, then it draws a line. Then you can say turn it by so much. Then the turtle turns. Then you say forward again, then it draws a line. So in this way, you can maybe draw triangles, polygons, circles. How do you draw a circle? Well, you have to draw very small segments, turn very little. The circle is a limiting case of a polygon. And all the interesting geometry that you read, long ago, and believe me, some engineering students have forgotten that geometry. And it actually gives them a kick to remember it. Because all that comes back. And in fact, in the very first lecture that I do, I use this package, which one of my TAs developed an year ago, the semester before I actually taught this course. And from day one, I can give them assignments which look exciting. The idea that you are commanding the turtle to do things is sort of a very vivid description of what a program is. You tell the turtle, do this, then do this, then do this, then do this. So the sequence, the notion of a sequence of instructions is very, very obvious. You don't have to really dwell on it. You don't even have to talk about it. You show the program on the screen, and it's clear that it's a program to do something. Can you illustrate iteration using this? Well, if I want to draw, say, lots of circles, or circles one following another, all I really need is a repeat instruction. So I do a repeat, and then I can, my repeat instruction naturally has a use, and I can use it to draw this pretty picture. Recursion, also, there are some rather interesting pictures that you can draw using recursion. That also works out very nicely. You can do things like, I can say, write a procedure called draw a house, and then that draws a house. The notion of why should I have a procedure? The question of why should I be having a procedure? What goes into it? All that, all those very trivial-looking syntax-related questions go through like breeze, there is no problem. Because what is happening is very clear. Most of the time, what happens when you teach a programming language is that what you are doing doing in that program itself is somewhat boring, or itself is not too clear, and therefore, the student has to understand what is supposed to happen with the program as well as understand the programming language, and that problem actually goes away. I use this for several things. Oh, okay, so actually, if you make a mistake in drawing a program, in writing a program which is drawing pretty pictures, what happens? Well, some other pretty picture which you didn't think of get strong. So it's a mistake, but your mistake comes out as a beautiful picture. So now you can play around with it, and you can debug it, but the debugging also becomes somewhat more interesting. Finally, once you have this package, you can use it for visualization. I taught trees, so binary search trees, but then I asked the students to draw them on the screen as well. So many things got cleared up as we did that. Here is one more rather important notion that the programming language which I was using has. So the programming language C++ has a notion of classes and class hierarchies. If you have seen C++ texts, then there are some class hierarchies which are invented. So what is the class hierarchy? So there is a car or whatever, there is a vehicle and then an automobile is a kind of a car. All of that is fine, there is nothing wrong with it. But once you have this geometry or graphics which you are actually using, there are some very natural hierarchies which come into play. For example, there is a notion of a shape class which is very, very, very natural. Or a, and then there can be different kinds of shapes. For example, there could be a line could be a shape or a polygon could be a shape, a circle could be a shape. And then it turns out that the turtle that we were talking about is actually an instance as is a kind of polygon. It's not just a simple polygon because it has some additional things that it can do. But that's exactly the whole point of object-oriented programming. So you have a class, then you make a modification to it. You get a new class, you make further modifications as and when needed. So you retain the features from the previous classes, but you can add your own features as well. So what can happen with this model is that you have a very, very concrete example which the students have sort of played throughout the course which they can relate to. And again the subject matter is already familiar by the time you are teaching them the concept. All right, so the introductory lecture, I want to say a little bit about that introductory lecture because most programming language textbooks have this notion that the first lecture should say hello world, should print out hello world. So this is fine, but it is sort of boring. At least I think of it as, I think of it as boring. There is, it should be a little bit more, okay. So what we did instead is that we had, we can introduce this graphics package immediately. And with that graphics package, we can drop pretty pictures on day one. And on day one, we can ask students to have homeworks which involve pretty pictures and they can start doing those homeworks on day one. So something non-trivial happens on day one. And I feel doing something non-trivial, something mildly exciting or shocking to the students is rather important on day one because that really sets the tone of how the course is going to be. So maybe I'll come back and I can show some of the lectures but maybe I'll just go through my talk first. The other idea which I tried to implement during the course was that every lecture should begin with a problem. As opposed to saying at the, what? As opposed to this. Instead of coming to the classroom or instead of beginning the chapter by saying, today we are going to learn about arrays, yawn, okay. So rather than that, begin with some problem perhaps, well one would hope a problem that students would care about, okay. So say the problem could be, we want to plot the movement of gas particles or charged particles and see how they collide, how they move because of their mutual attraction and repulsion, okay. So that's the problem. We have 50 particles. We want to see how they attract. We want to plot the next step, okay. They are currently there somewhere in space. They move forward. How do they move forward? Well, here is a chance to connect the learning of programming with physics or whatever they have learned before, okay. So they interact because of Coulombic forces and you can calculate the next step and this really is a very, very important idea because simulation is rather important in programming, rather important in science in general and in fact, this kind of simulation is routinely done if your students are engineering students or science students, they should really get this view of the world and the view of programming, okay. So this is the problem that we want to solve. So far we have not seen anything like arrays. So we really would be hard pressed to solve this problem and therefore here is a new statement which enables us to solve this problem, okay. So I tried to make every lecture of this kind. So it means sort of trying to come up with problems which students will identify with it but I think it is worth it, okay. At the end of the day, the students, if the problems are interesting to the students then the concepts are appreciated much better, okay. So the next important theme, some of these themes have sort of thought of in hindsight in the response to Professor Fatak's suggestion that I give this lecture but I'll stand by everyone, I mean. I think I really believe in everything that I'm saying. But I can't really say that I designed the course with all of these things very, very consciously in mind, okay. So for every concept, you must have good motivating with the examples, okay. And you must also discuss implementation. So I think there is a feeling that students don't like implementation but I think that's not quite true. If you discuss it properly, students do understand the implementation it actually clarifies the concept quite well. Say for example, recursion. So you should discuss, go over quite calmly what happens as each recursive call takes place. Draw out all the pictures painstakingly. It's really worth it, okay. Same thing about pointers. So where is this heap memory? How is it allocated? I think students like it because students really, I mean, students get a kick if they know that they are really understanding something which is at the root of all these systems. So I don't think they are reluctant or they are uninterested. And I don't think the problem always is the difficulty. I think students don't mind difficulty if there is some payoff, if they get a sense of accomplishment, difficulty is okay, okay. Like climbing mountains. If you're going to see a great view, it's quite fine to climb mountains. Generalization is also important. If you explain a concept in one context, if it applies in another context, that reinforces that concept, okay. So for example, you explain pointers in connection with, and you used it to build lists. But once you use it to build lists, building trees is really not that difficult. But then why should you be doing it? Well, for several reasons, there are some very nice things about trees. But at the same time, it reinforces the idea that pointers are very, very general. They are not implemented, they are not meant only for lists, okay. So the whole point is that most of the concepts that we are teaching have very general application, okay. So students should not think of pointers as associated only with lists. And of course, if they see that they can use pointers anywhere, if they see that there is this freedom to use pointers, I think then that helps. And here is an interesting exercise that I found, say use recursion to draw trees on the screen. So use build binary search trees and then use recursion to draw those trees on the screen. So students quite like this. So it exercised recursion, it exercised pointers, it exercised drawing. So that turned out to be quite nice. Connecting to other disciplines is quite important. For example, the course that I taught had example of Newton's method for finding roots. So that was quite, that students, I guess these students actually see that in 12 standard or something like that. But a number of students came back and said when we actually did the computations, we realized that we perhaps didn't understand it as well when we had learned them in the 12 standard. Only after we did the calculations, we actually understood what exactly was going on. So that was quite nice. So I have talked about simulating the moment of charge particles. Here is another theme that I perhaps should have pulled out separately. But so from time to time there are ideas which have some Indian element in them. So the numbers that we know as Fibonacci numbers actually were invented by a mathematician called Himachandra some 50 to 100 years ago. And there is in fact some evidence that these numbers, so that this invention traveled over Arabia and the Middle East to Italy. And that's how Fibonacci actually saw them. You can't be sure about these things, but there is some evidence. Wikipedia actually talks about all these things. So it's interesting the context in which Himachandra invented these numbers. So he was asking questions about poetic meters. So he was actually a poet mathematician and he was saying things like, suppose I have say some four beats. I think many people here are, so anyway, so there is a notion of matra. So I can have two matras go into or two words go into one matra and or just one long word go into another matra, into a matra and things like that. So am I going to put the effect, the audio effect of whether I put in two words into a matra or two syllables into a matra or one syllable into a matra is very different. So whether I put in a long syllable or two short syllables feels very different to the year. So Himachandra was concerned with this question. Suppose I have four matras, then I can break them up as two short syllables followed by all four short syllables. So a sequence of eight short syllables or I could break them up as say two long syllables followed by two short syllables followed by one long syllable. So there are several such possibilities. So he and a group of other mathematicians asked all interesting natural questions about this notion. For example, in these so many matras, if I want to fit in so many syllables, how many different ways are there of doing it? And the Fibonacci numbers or the Himachandra numbers as perhaps you should call them arise from doing this counting. Turns out that the nth Himachandra number is really the solution to the problem of how many ways are there of generating poetic meters of a certain kind. So I feel that it's important to tell this story that this actually is an Indian scientist of ancient times and also connected to something unexpected like poetry. So usually our examples tend to be connecting things to engineering, but if you can connect things to poetry, great. I think we should do it. So we should have nice algorithms. Newton's algorithm turns out to be quite nice. I think students like it. If you are searching trees, especially if you visualize them, visualize it with the turtle viewing of the screen, that looks, that works quite well. Students reported that they liked that kind of a demonstrative programming assignment. Another interesting algorithm which I talked about. And at this point, I realize I'm getting into the details of a course, treat my examples, treat the problems that I'm stating as examples rather than specifically what problems you should do. But I'll tell you why I took several of these problems. So for example, there are some very simple nice algorithms to find shortest paths in a graph. These are based on matrix multiplication. But the interesting thing is that they require you to represent infinities. So I want to say that the distance, that there is no path between this point and this point. So I represent that by saying the distance between this point and this point is infinity. If this distance is infinity and if there is some other path and if I want to do some arithmetic on infinities, turns out that C plus plus actually supports it. C plus plus allows you to do arithmetic on infinities. So there is this IEEE floating point standard, which you could talk about at some point. But rather than talk about that IEEE floating point standard, you could say that look, I'm not going to worry about how large an exponent is. You should know it roughly. Or who devised this floating point standard? When did it come about? All of that. But let us look at some interesting uses of that floating point standard. So say for example, I can have a floating point number, which is symbolically known as huge val. I think there is some math library which contains that. And then I can say things like huge val plus huge val is also equal to huge val. Or say minimum of 55 and huge val is 55. I can do it. I can write C plus plus ordinary programming statements and all that will happen automatically. And it turns out that this comes in very handy in this shortest path example. And my experience was that by and large students had learned matrix multiplication. But they had really not seen great examples at the first year level at which this course was taught. So by doing this example, I was able to connect some of the mathematics that they had already learned to the programming, to IEEE floating point standards. And making all these connections is actually quite interesting as far as students are concerned. Towards the end of the course, I provided to the students what is called an event loop in graphics programming. So basically just as you can wait on, say, the console in, you can wait for something to be typed. You can wait for an event to happen, like maybe a mouse is dragged or a key is pressed or whatever. And based on that, you could take actions. So essentially this resulted in students being able to develop video games. So many students, as you might believe, really enjoyed that. I mean, probably you would expect that being able to develop your own video game is probably a fantasy for many students. And as expected, they liked it. I could have talked about the more standard way of doing this, which is to have this notion of event-driven programming, listeners, and all of that. I didn't do that because it was very heavy on syntax. Whereas this event loop was using concepts that they already knew. And they could actually get to something interesting. So the idea again was that if you do things using which students can further their own agenda. But as a by-product learn whatever you are trying to teach them, that's great. So that's really the motivation in doing this. So there were several lab assignments. This is sort of a general remark. This may not apply everywhere. But I designed several lab assignments. TA has graded these lab assignments. I was worried that students might copy. And therefore I didn't keep very heavy weightage to these labs, give very heavy weightage to the lab assignments. But anecdotally, the students told me that they liked the assignments. And it helped them understand the material. This is really an interesting point which I should mention. So in the classroom that I was teaching, there was a tablet or whatever writing pad of this kind. And it so happened that one week because the internet was down, I was not able to download my slides. And so I used that writing tablet. And at the end of the lecture, several students came to me and said, look, don't bother with the slides. Use that tablet. And then from that point onwards, I switched to writing on that. And I guess it helps in developing the lecture gradually rather than slides with which material comes up in a flash. And there is a tendency to speed up a little bit. So if you are using the blackboard or if you have a tablet of this kind, I would recommend going with it. This is the feedback that I have had not only in this course and other courses as well. Use the blackboard because you can develop the material slowly. Here are a few things that I would like to do, but I didn't get time or somehow I didn't do it. C++ has this string class, which is quite useful, which can be a source of rather interesting set of programs. I didn't do it mostly because of time. One thing which I really regret not doing is talking more about assertions and generally reasoning about programs. I talked about it a little bit, but perhaps some more formal discussion, I think, is necessary. The standard template libraries of C++ and the algorithms class, which is provided in C++ also, I think, deserves more weightage than I gave. I could have talked a lot more about programming style. I talked a little bit. I could have also talked more about debuggers and IDs and things like that. I didn't do that much on this counter either. I suspect that in most places, the programming introductory course would have three hours per week rather than two hours as we did. So perhaps all this can be done quite comfortably. I think that's it. I'm at the end of my talk.