1 00:00:00,000 --> 00:00:13,000 2 00:00:13,000 --> 00:00:16,000 This presentation is delivered by the Stanford Center for Professional 3 00:00:16,000 --> 00:00:27,000 Development. 4 00:00:27,000 --> 00:00:30,000 Hi. Welcome to CS106B, programming [inaudible]. The 5 00:00:30,000 --> 00:00:31,000 6 00:00:31,000 --> 00:00:33,000 7 00:00:33,000 --> 00:00:34,000 8 00:00:34,000 --> 00:00:37,000 website was probably the most important thing to take away from here, 9 00:00:37,000 --> 00:00:40,000 right, is where can you find information about the class? We're going to talk today and give some 10 00:00:40,000 --> 00:00:42,000 overview and stuff like that, but this is kind of the home base for 11 00:00:42,000 --> 00:00:45,000 all the material. If you managed to get the handouts on the way in, you're 12 00:00:45,000 --> 00:00:48,000 golden. Otherwise, you can grab them from the website. There's a lot of background 13 00:00:48,000 --> 00:00:51,000 information, staff information, office hours, all sorts of stuff gathered there. 14 00:00:51,000 --> 00:00:53,000 It's kind of one stop shopping for 15 00:00:53,000 --> 00:00:56,000 figuring things out about our course. Let me tell you 16 00:00:56,000 --> 00:00:57,000 what I'm 17 00:00:57,000 --> 00:00:58,000 going to do today. The 18 00:00:58,000 --> 00:01:01,000 first day, I know a lot of you are shopping and trying to figure out what's the 19 00:01:01,000 --> 00:01:04,000 right fit for you, so hopefully today, I'm going to try to give you some information that will 20 00:01:04,000 --> 00:01:05,000 help you make a good decision. I 21 00:01:05,000 --> 00:01:07,000 want to tell you a little bit of what our course is about, 22 00:01:07,000 --> 00:01:10,000 tell you about the administration and logistics - most of that stuff is pretty 23 00:01:10,000 --> 00:01:11,000 ordinary, and you can read about it. 24 00:01:11,000 --> 00:01:13,000 Of course, I have to do a little bit of marketing. 25 00:01:13,000 --> 00:01:15,000 I get to give you my unbiased opinions of why this is the absolute 26 00:01:15,000 --> 00:01:17,000 best class you could possibly take. 27 00:01:17,000 --> 00:01:20,000 I get paid per student, you know. 28 00:01:20,000 --> 00:01:22,000 That's not true. 29 00:01:22,000 --> 00:01:23,000 30 00:01:23,000 --> 00:01:25,000 Maybe we'll even have time to check out a little bit of the C++ language 31 00:01:25,000 --> 00:01:29,000 before we're done. 32 00:01:29,000 --> 00:01:32,000 Let 33 00:01:32,000 --> 00:01:33,000 me tell you 34 00:01:33,000 --> 00:01:37,000 about CS106. CS106 is the introductory programming sequence here at Stanford. It's 35 00:01:37,000 --> 00:01:40,000 our version of CS1, where you start at the beginning 36 00:01:40,000 --> 00:01:43,000 when you are interested in learning more about programming. 37 00:01:43,000 --> 00:01:46,000 We have a two-quarter sequence, A and B, that kind of follow together. They're not 38 00:01:46,000 --> 00:01:50,000 particularly tightly coupled, which is to say if you took A and you took a break, 39 00:01:50,000 --> 00:01:53,000 you could come back to B. 40 00:01:53,000 --> 00:01:55,000 41 00:01:55,000 --> 00:01:58,000 42 00:01:58,000 --> 00:01:59,000 43 00:01:59,000 --> 00:02:03,000 We also have an alternate form of B, the CS106X, which is kind of an honors 44 00:02:03,000 --> 00:02:06,000 version of that second course. So after you've taken that first course and you're 45 00:02:06,000 --> 00:02:08,000 feeling really jazzed up, 46 00:02:08,000 --> 00:02:11,000 there is an alternative more intense way to get through the second course that's 47 00:02:11,000 --> 00:02:14,000 offered. It's offered this quarter, in fact, so if you're 48 00:02:14,000 --> 00:02:17,000 thinking about that, that is an option for you as well as 49 00:02:17,000 --> 00:02:18,000 sticking with us. 50 00:02:18,000 --> 00:02:23,000 What do we do in 106A? The official title is programming methodology. 51 00:02:23,000 --> 00:02:25,000 It is starting at the very beginning 52 00:02:25,000 --> 00:02:29,000 and assuming you have no background in programming. It's teaching you how it works, 53 00:02:29,000 --> 00:02:32,000 what the languages look like, what the syntax is like, what things you need 54 00:02:32,000 --> 00:02:34,000 to know about how to solve problems using a computer. 55 00:02:34,000 --> 00:02:37,000 It covers a lot of the fundamentals 56 00:02:37,000 --> 00:02:41,000 about logic control and in general, I think the big issues of 106A 57 00:02:41,000 --> 00:02:45,000 have less to do with any particular syntax or feature that you learn about a 58 00:02:45,000 --> 00:02:46,000 language but 59 00:02:46,000 --> 00:02:49,000 about how do you solve problems on a computer? Somebody gives you a specification of you 60 00:02:49,000 --> 00:02:52,000 need to write a program that does X, and you have to figure out how to make that 61 00:02:52,000 --> 00:02:52,000 happen, 62 00:02:52,000 --> 00:02:54,000 how to break it down, 63 00:02:54,000 --> 00:02:57,000 how to step through it, how to develop it, how to test it, 64 00:02:57,000 --> 00:03:00,000 how to iterate on it, how to make changes in it later, 65 00:03:00,000 --> 00:03:04,000 how to debug it when it's not working well, and those things, I think, transcend 66 00:03:04,000 --> 00:03:08,000 any particular language. W e happen to use the Java programming language in our 67 00:03:08,000 --> 00:03:09,000 106A course 68 00:03:09,000 --> 00:03:11,000 because it's a great tool for 69 00:03:11,000 --> 00:03:13,000 introductory programming, 70 00:03:13,000 --> 00:03:16,000 but I don't think of that as being really critical. In fact, if your introductory 71 00:03:16,000 --> 00:03:19,000 course was in some other fairly modern, high level language 72 00:03:19,000 --> 00:03:20,000 - let's say 73 00:03:20,000 --> 00:03:23,000 you learned in Python, C, 74 00:03:23,000 --> 00:03:25,000 Scheme, or something other than Java, 75 00:03:25,000 --> 00:03:28,000 you're probably still fine, 'cause what we're really counting on in B is that you know how to 76 00:03:28,000 --> 00:03:29,000 program and think 77 00:03:29,000 --> 00:03:32,000 like a computer scientist. 78 00:03:32,000 --> 00:03:34,000 Not a lot of the details of the syntax 79 00:03:34,000 --> 00:03:37,000 are going to be important to us. B 80 00:03:37,000 --> 00:03:40,000 picks up from there, saying okay, you've got some fundamentals. 81 00:03:40,000 --> 00:03:43,000 Let's start really learning some of the techniques that extend the range of 82 00:03:43,000 --> 00:03:45,000 problems you can solve. 83 00:03:45,000 --> 00:03:49,000 We look at recursion, which is one of the fundamental problem solving 84 00:03:49,000 --> 00:03:50,000 techniques that involves using 85 00:03:50,000 --> 00:03:53,000 something akin to mathematical induction to solve problems in terms of 86 00:03:53,000 --> 00:03:54,000 themselves. 87 00:03:54,000 --> 00:03:57,000 Looking at a lot of algorithms for sorting and searching and hashing and doing 88 00:03:57,000 --> 00:04:01,000 things efficiently, knowing how to compare and contrast alternatives in algorithms, 89 00:04:01,000 --> 00:04:01,000 90 00:04:01,000 --> 00:04:05,000 having some formalisms by which to discuss those things, and learn some of the 91 00:04:05,000 --> 00:04:08,000 classics that are out there for solving these problems. 92 00:04:08,000 --> 00:04:11,000 The dynamic data structure, which involves use of pointers to construct things 93 00:04:11,000 --> 00:04:14,000 like lists, trees and heaps, graphs 94 00:04:14,000 --> 00:04:15,000 that 95 00:04:15,000 --> 00:04:18,000 model certain structures that are very effective in solving certain kinds of 96 00:04:18,000 --> 00:04:21,000 problems - we'll work through those. A large part of our time is spent on this concept 97 00:04:21,000 --> 00:04:25,000 of data extraction, which is why extraction shows up as the 98 00:04:25,000 --> 00:04:27,000 main word in our title. 99 00:04:27,000 --> 00:04:31,000 As we start to solve more and more complex problems, the code 100 00:04:31,000 --> 00:04:34,000 itself can kind of become overwhelming if we don't have some 101 00:04:34,000 --> 00:04:36,000 technique for managing that complexity. 102 00:04:36,000 --> 00:04:39,000 One of the big themes for 106B is how we can use this idea of 103 00:04:39,000 --> 00:04:42,000 extraction, building something and dealing with the low level details but then 104 00:04:42,000 --> 00:04:44,000 closing up the box and treating it 105 00:04:44,000 --> 00:04:48,000 as kind of a fixed entity and building on top of that and then closing another 106 00:04:48,000 --> 00:04:49,000 layer around that 107 00:04:49,000 --> 00:04:52,000 as a way of working on something, finishing it and moving on to some 108 00:04:52,000 --> 00:04:56,000 larger piece without having those details cloud our way. It's a very 109 00:04:56,000 --> 00:04:59,000 powerful technique for solving larger 110 00:04:59,000 --> 00:05:00,000 problems. In that 111 00:05:00,000 --> 00:05:04,000 context, we'll be looking at some of the classic data structures, like stacks, cubes, 112 00:05:04,000 --> 00:05:06,000 lists, maps and sets 113 00:05:06,000 --> 00:05:08,000 as part of the domain for that. 114 00:05:08,000 --> 00:05:11,000 We do happen to use the C++ programming language, 115 00:05:11,000 --> 00:05:14,000 but this is not a C++ course, so to be clear about what you're 116 00:05:14,000 --> 00:05:16,000 getting versus what you wanted, 117 00:05:16,000 --> 00:05:20,000 we use Java here. We use C++ here. We happen to 118 00:05:20,000 --> 00:05:23,000 think they're good reasons to actually expose you to both languages. 119 00:05:23,000 --> 00:05:26,000 120 00:05:26,000 --> 00:05:29,000 In particular, C++ is an enormous language. It 121 00:05:29,000 --> 00:05:32,000 has a lot of language features as well as a very large standard library, 122 00:05:32,000 --> 00:05:36,000 and our goal is not at all to turn you into this industrial strength knows 123 00:05:36,000 --> 00:05:37,000 every detail about quirks 124 00:05:37,000 --> 00:05:41,000 and ins and outs of C++. There is another class, 193D, that 125 00:05:41,000 --> 00:05:43,000 does attempt to do that. In fact, if 126 00:05:43,000 --> 00:05:45,000 that's what you're looking for, 127 00:05:45,000 --> 00:05:47,000 I suggest you take a look at that. 128 00:05:47,000 --> 00:05:50,000 What we're here about is learning advanced programming techniques - taking 129 00:05:50,000 --> 00:05:54,000 those foundations and building on them to be able to solve more interesting problems. 130 00:05:54,000 --> 00:05:56,000 We happen to use C++. You will learn some C++, but I almost 131 00:05:56,000 --> 00:05:58,000 consider it a side effect 132 00:05:58,000 --> 00:06:00,000 of what we're doing. 133 00:06:00,000 --> 00:06:01,000 134 00:06:01,000 --> 00:06:04,000 135 00:06:04,000 --> 00:06:06,000 Just a little note on placement 136 00:06:06,000 --> 00:06:09,000 - if you're kind of in between and not really sure, 137 00:06:09,000 --> 00:06:13,000 these are the very rough guidelines, but they give you 138 00:06:13,000 --> 00:06:16,000 some idea of which groups 139 00:06:16,000 --> 00:06:17,000 gravitate where. 140 00:06:17,000 --> 00:06:20,000 If you are new to programming or you're not confident about your background - maybe 141 00:06:20,000 --> 00:06:23,000 it was a long time ago. Maybe it was self-taught. Maybe it was in a course that you 142 00:06:23,000 --> 00:06:26,000 felt was not as good as it could have been 143 00:06:26,000 --> 00:06:27,000 or you didn't do as well in it, 144 00:06:27,000 --> 00:06:29,000 106A is a great place to start. 145 00:06:29,000 --> 00:06:31,000 It actually is by 146 00:06:31,000 --> 00:06:34,000 all accounts an extremely popular course at Stanford 147 00:06:34,000 --> 00:06:36,000 and services a wide 148 00:06:36,000 --> 00:06:39,000 group of people with a little bit of background or no background. 149 00:06:39,000 --> 00:06:42,000 150 00:06:42,000 --> 00:06:45,000 If you do have something like a solid first course experience - you did well in 151 00:06:45,000 --> 00:06:48,000 106A or took a similar course or perhaps even self-taught your way 152 00:06:48,000 --> 00:06:52,000 through a lot of those materials and you feel ready to move on, 153 00:06:52,000 --> 00:06:55,000 106B. An AP course in high school - 154 00:06:55,000 --> 00:06:59,000 the A curriculum is a pretty good match for 106A here, so you're in a 155 00:06:59,000 --> 00:07:00,000 great place. 156 00:07:00,000 --> 00:07:01,000 If you have this and 157 00:07:01,000 --> 00:07:04,000 you've got a little bit more going for you or you're super enthused and you have a 158 00:07:04,000 --> 00:07:06,000 lot of extra time this quarter 159 00:07:06,000 --> 00:07:09,000 and want to sit in the company of only 160 00:07:09,000 --> 00:07:11,000 the uber geeks, 161 00:07:11,000 --> 00:07:13,000 you can check out 106X, 162 00:07:13,000 --> 00:07:17,000 which covers the same kind of topical ground 163 00:07:17,000 --> 00:07:20,000 but at a different level intensity. It amps up a little bit of the 164 00:07:20,000 --> 00:07:24,000 assignments, covers some of the material that we won't get a chance to cover, 165 00:07:24,000 --> 00:07:25,000 and 166 00:07:25,000 --> 00:07:27,000 just pushes the envelope a little bit there. 167 00:07:27,000 --> 00:07:30,000 If you have experience comparable to the first two courses 168 00:07:30,000 --> 00:07:31,000 - you've 169 00:07:31,000 --> 00:07:34,000 done all the things that we're talking about here in B and you feel 170 00:07:34,000 --> 00:07:35,000 comfortable with it, 171 00:07:35,000 --> 00:07:37,000 it might be that the right place for you is 107, 172 00:07:37,000 --> 00:07:40,000 which is the third course in our sequence. 173 00:07:40,000 --> 00:07:44,000 That's 174 00:07:44,000 --> 00:07:47,000 somewhat rare, so if you're thinking about that, I encourage you to 175 00:07:47,000 --> 00:07:49,000 talk to me a little bit to make sure that you won't be missing out on 176 00:07:49,000 --> 00:07:51,000 something important 177 00:07:51,000 --> 00:07:54,000 in doing so, but certainly there are students who have - for example, the 178 00:07:54,000 --> 00:07:55,000 179 00:07:55,000 --> 00:07:59,000 APCSAD curriculum is pretty comparable to this course here, 180 00:07:59,000 --> 00:08:03,000 and so depending on how high quality the course you had was, it might very well be 181 00:08:03,000 --> 00:08:04,000 that 107 is right. 182 00:08:04,000 --> 00:08:06,000 In some situations where that course was a little bit lacking, there may be some 183 00:08:06,000 --> 00:08:10,000 ways that we can help reinforce the things you've learned 184 00:08:10,000 --> 00:08:12,000 and build a stronger foundation to move forward from rather 185 00:08:12,000 --> 00:08:15,000 than jumping ahead. 186 00:08:15,000 --> 00:08:18,000 Any questions about placement? 187 00:08:18,000 --> 00:08:20,000 188 00:08:20,000 --> 00:08:22,000 Let's 189 00:08:22,000 --> 00:08:25,000 talk 190 00:08:25,000 --> 00:08:28,000 191 00:08:28,000 --> 00:08:28,000 192 00:08:28,000 --> 00:08:30,000 193 00:08:30,000 --> 00:08:30,000 philosophy. 194 00:08:30,000 --> 00:08:34,000 I think there's a statement about what we officially are, 195 00:08:34,000 --> 00:08:38,000 but I also think that 106 has a long tradition at Stanford 196 00:08:38,000 --> 00:08:40,000 that comes back from student motivation, which is interesting. I was here 197 00:08:40,000 --> 00:08:43,000 as an undergrad in the 80s when the 106s were just 198 00:08:43,000 --> 00:08:45,000 getting off the ground, 199 00:08:45,000 --> 00:08:49,000 and at the time, Stanford only had a graduate computer science department, and 200 00:08:49,000 --> 00:08:52,000 the belief in the ancient period for computer science 201 00:08:52,000 --> 00:08:55,000 was you should get a math degree, and only then would you be mature enough 202 00:08:55,000 --> 00:08:57,000 to learn about computers. 203 00:08:57,000 --> 00:08:58,000 There 204 00:08:58,000 --> 00:09:00,000 205 00:09:00,000 --> 00:09:02,000 was a groundswell of Stanford 206 00:09:02,000 --> 00:09:06,000 students who said we want access to programming. We want it. Part of the 207 00:09:06,000 --> 00:09:09,000 106 was a really careful thought about what the 106 208 00:09:09,000 --> 00:09:12,000 would be a Stanford and what we want them to be 209 00:09:12,000 --> 00:09:15,000 in a philosophical sense. One is that we welcome students of all 210 00:09:15,000 --> 00:09:19,000 majors and backgrounds. We don't have a version of 106 that's for the majors or 211 00:09:19,000 --> 00:09:22,000 potential majors and a version that's for the non-majors and a version that's for 212 00:09:22,000 --> 00:09:24,000 terminals. 213 00:09:24,000 --> 00:09:27,000 We really think that we can bring you all together 214 00:09:27,000 --> 00:09:31,000 and design a course that addresses this wide 215 00:09:31,000 --> 00:09:34,000 disparate group but still serves it well. 216 00:09:34,000 --> 00:09:36,000 217 00:09:36,000 --> 00:09:39,000 I'm going to turn you into a CS major. That's my plan. At 218 00:09:39,000 --> 00:09:42,000 Stanford right now, not having to make that choice about a major 219 00:09:42,000 --> 00:09:44,000 until junior year 220 00:09:44,000 --> 00:09:45,000 221 00:09:45,000 --> 00:09:49,000 is a gift to allow you to explore and to feel unencumbered by having made some 222 00:09:49,000 --> 00:09:51,000 decision when you applied, and I think it's important to respect that 223 00:09:51,000 --> 00:09:54,000 gift that Stanford gave you by trying to make sure our courses don't funnel you one way or 224 00:09:54,000 --> 00:09:56,000 the other before you figure it out. 225 00:09:56,000 --> 00:09:57,000 226 00:09:57,000 --> 00:10:00,000 You are all welcome here. We try to make it accessible to everyone. We have certain plans 227 00:10:00,000 --> 00:10:03,000 that help to make that work. 228 00:10:03,000 --> 00:10:07,000 We do try to provide a solid, practical foundation in programming 229 00:10:07,000 --> 00:10:11,000 that given our placement at Stanford in the middle of the Silicon Valley, 230 00:10:11,000 --> 00:10:14,000 there's kind of a strong influence for us to try to produce students 231 00:10:14,000 --> 00:10:16,000 who from the get go are 232 00:10:16,000 --> 00:10:18,000 learning things that are actually quite useful 233 00:10:18,000 --> 00:10:19,000 outside of the classroom 234 00:10:19,000 --> 00:10:22,000 rather than teach you a very academic 235 00:10:22,000 --> 00:10:24,000 and mathematical language like Scheme 236 00:10:24,000 --> 00:10:27,000 that is very 237 00:10:27,000 --> 00:10:31,000 rarely used outside of the classroom. We're trying to teach you on the tools, 238 00:10:31,000 --> 00:10:34,000 languages and techniques that are actually in active practice. 239 00:10:34,000 --> 00:10:38,000 We are using Java and C++, two of the most prevalent languages out in the 240 00:10:38,000 --> 00:10:39,000 industry, and 241 00:10:39,000 --> 00:10:42,000 we do a lot of learn by doing. We assign challenging, full-fledged 242 00:10:42,000 --> 00:10:45,000 programs that you work on and you build, and so it's not designed to be 243 00:10:45,000 --> 00:10:47,000 academic exercises. 244 00:10:47,000 --> 00:10:52,000 You really are building skills that have applicability here and 245 00:10:52,000 --> 00:10:55,000 outside of the class. 246 00:10:55,000 --> 00:10:58,000 We have a big emphasis on 247 00:10:58,000 --> 00:11:01,000 truth and beauty. 248 00:11:01,000 --> 00:11:03,000 This is one area in which some of the 249 00:11:03,000 --> 00:11:04,000 substitute courses 250 00:11:04,000 --> 00:11:07,000 that we have seen students come in with have a little bit more trouble with 251 00:11:07,000 --> 00:11:10,000 is tackling this part of it, which is that there are 252 00:11:10,000 --> 00:11:12,000 a lot of ways you can get a program to work. 253 00:11:12,000 --> 00:11:14,000 Many of them are not pretty. 254 00:11:14,000 --> 00:11:17,000 You can just type and type and type and 255 00:11:17,000 --> 00:11:19,000 eventually, you can get your way to something 256 00:11:19,000 --> 00:11:22,000 257 00:11:22,000 --> 00:11:25,000 that works. 258 00:11:25,000 --> 00:11:27,000 That, in the end, might produce a program that from 259 00:11:27,000 --> 00:11:28,000 external appearances works. 260 00:11:28,000 --> 00:11:31,000 It plays hangman or whatever was the 261 00:11:31,000 --> 00:11:32,000 desired goal, 262 00:11:32,000 --> 00:11:34,000 but that internally is a mess. 263 00:11:34,000 --> 00:11:38,000 It's not well structured. It's not well [inaudible]. It's not easy to understand. It 264 00:11:38,000 --> 00:11:40,000 wouldn't be easy to modify. 265 00:11:40,000 --> 00:11:42,000 It makes a lot of decision that are really sub optimal, 266 00:11:42,000 --> 00:11:48,000 and we're really interested in producing engineers that have a good 267 00:11:48,000 --> 00:11:52,000 sense of design and really appreciate what is involved in writing 268 00:11:52,000 --> 00:11:56,000 good, well designed software, not just working software. We will be 269 00:11:56,000 --> 00:11:57,000 giving you 270 00:11:57,000 --> 00:12:00,000 feedback on both the correctness and functionality of your code 271 00:12:00,000 --> 00:12:01,000 272 00:12:01,000 --> 00:12:03,000 but 273 00:12:03,000 --> 00:12:05,000 as important if not more so, 274 00:12:05,000 --> 00:12:08,000 also on how well we think you did at designing and implementing and 275 00:12:08,000 --> 00:12:10,000 writing code that is of 276 00:12:10,000 --> 00:12:11,000 a high quality. 277 00:12:11,000 --> 00:12:14,000 We make a big deal out of that. That is something that is not always shared by 278 00:12:14,000 --> 00:12:17,000 other classes, and so in particular, someone who is self taught or in a class that didn't 279 00:12:17,000 --> 00:12:20,000 emphasize this might feel that there's a little bit of a gap there where we need to make 280 00:12:20,000 --> 00:12:21,000 that up with you, 281 00:12:21,000 --> 00:12:24,000 and we can work with you. This is a very individual thing, because there's not one good example 282 00:12:24,000 --> 00:12:26,000 of 283 00:12:26,000 --> 00:12:28,000 the perfect style 284 00:12:28,000 --> 00:12:31,000 in the way that a lot of different people 285 00:12:31,000 --> 00:12:34,000 express themselves in written communication 286 00:12:34,000 --> 00:12:36,000 very well but differently. The same thing is true about programs. You will have 287 00:12:36,000 --> 00:12:40,000 your own unique style, and we'll work with you to coach you on getting your 288 00:12:40,000 --> 00:12:42,000 style to come through and 289 00:12:42,000 --> 00:12:46,000 be beautiful and elegant. 290 00:12:46,000 --> 00:12:50,000 This kind of comes back to point one as well is that we make heavy use of 291 00:12:50,000 --> 00:12:53,000 undergraduate section leaders as mentors in this program. We have a staff of 292 00:12:53,000 --> 00:12:53,000 293 00:12:53,000 --> 00:12:55,000 50 or so 294 00:12:55,000 --> 00:12:59,000 undergraduates who work with the 106A, B and X courses as a team. 295 00:12:59,000 --> 00:13:02,000 They have specific responsibilities with their section, 296 00:13:02,000 --> 00:13:06,000 so mentoring and grading and meeting with 297 00:13:06,000 --> 00:13:09,000 sections to give individualized feedback on their programs 298 00:13:09,000 --> 00:13:10,000 as well as 299 00:13:10,000 --> 00:13:13,000 answering questions, solving problems, being in the lair 30 plus hours. 300 00:13:13,000 --> 00:13:16,000 They're most weekday nights about six hours 301 00:13:16,000 --> 00:13:17,000 and often 302 00:13:17,000 --> 00:13:20,000 well past the midnight when it's supposed to cut off solving people's problems, 303 00:13:20,000 --> 00:13:23,000 helping when you get stuck, answering your questions 304 00:13:23,000 --> 00:13:26,000 and making sure you're all making forward progress. 305 00:13:26,000 --> 00:13:29,000 That comes back to point one. In some universities where they're 306 00:13:29,000 --> 00:13:31,000 choosing to use their intro course as a weeder, it's 307 00:13:31,000 --> 00:13:34,000 like let's separate the weak from the [inaudible] early and let's make it really 308 00:13:34,000 --> 00:13:35,000 hard and 309 00:13:35,000 --> 00:13:38,000 not provide too much support, and that way we'll make sure we get the people we want. 310 00:13:38,000 --> 00:13:41,000 We have a different idea. Programming is hard, 311 00:13:41,000 --> 00:13:42,000 especially when you're learning. 312 00:13:42,000 --> 00:13:46,000 There's a lot of complexity to master, and there are a lot of details that can 313 00:13:46,000 --> 00:13:49,000 interfere with moving forward, and we don't want you 314 00:13:49,000 --> 00:13:52,000 to get stuck on something that we can very easily resolve for you. So make 315 00:13:52,000 --> 00:13:54,000 sure you have accessible 316 00:13:54,000 --> 00:13:56,000 staff members in person, in email 317 00:13:56,000 --> 00:13:58,000 and regularly in session 318 00:13:58,000 --> 00:14:04,000 to help get through the roadblocks and keep you moving forward. 319 00:14:04,000 --> 00:14:08,000 What do you need to know to be sure you're going to do well? There 320 00:14:08,000 --> 00:14:08,000 are 321 00:14:08,000 --> 00:14:12,000 people who think to be a good computer 322 00:14:12,000 --> 00:14:15,000 programmer, you need to be good at math, logic, and 323 00:14:15,000 --> 00:14:16,000 drinking Jolt. I 324 00:14:16,000 --> 00:14:18,000 think 325 00:14:18,000 --> 00:14:19,000 326 00:14:19,000 --> 00:14:22,000 it comes down to more personality traits than any 327 00:14:22,000 --> 00:14:23,000 particular 328 00:14:23,000 --> 00:14:26,000 technique or skill. You don't need to be good at math. 329 00:14:26,000 --> 00:14:29,000 How much calculus and trig shows up in this? Not 330 00:14:29,000 --> 00:14:32,000 very much. A little bit of logic - that helps. 331 00:14:32,000 --> 00:14:35,000 I think it comes down to traits like curiosity and determination and 332 00:14:35,000 --> 00:14:37,000 hard work. 333 00:14:37,000 --> 00:14:38,000 Starting early, 334 00:14:38,000 --> 00:14:41,000 asking questions when you don't understand something, 335 00:14:41,000 --> 00:14:44,000 trying to solve the problem by 336 00:14:44,000 --> 00:14:47,000 logic - why does this case work and why does that case not work? 337 00:14:47,000 --> 00:14:49,000 338 00:14:49,000 --> 00:14:51,000 339 00:14:51,000 --> 00:14:56,000 340 00:14:56,000 --> 00:14:57,000 341 00:14:57,000 --> 00:15:00,000 I think these are the skills that serve you the best 342 00:15:00,000 --> 00:15:03,000 in this class and probably every other thing you'd want to 343 00:15:03,000 --> 00:15:04,000 tackle. 344 00:15:04,000 --> 00:15:08,000 There is a lot of time that will be spent here to master this. 345 00:15:08,000 --> 00:15:12,000 I can talk about programming all I want, and you can go oh, yeah, that makes a 346 00:15:12,000 --> 00:15:14,000 lot of sense. But when you go to write it yourself, 347 00:15:14,000 --> 00:15:16,000 it's a very different experience. That's where 348 00:15:16,000 --> 00:15:17,000 being 349 00:15:17,000 --> 00:15:20,000 focused and staying on task 350 00:15:20,000 --> 00:15:22,000 and getting help when you get stuck 351 00:15:22,000 --> 00:15:26,000 can help you move through 352 00:15:26,000 --> 00:15:27,000 353 00:15:27,000 --> 00:15:31,000 354 00:15:31,000 --> 00:15:35,000 355 00:15:35,000 --> 00:15:36,000 that. 356 00:15:36,000 --> 00:15:40,000 357 00:15:40,000 --> 00:15:43,000 My unbiased opinion about why 106B is 358 00:15:43,000 --> 00:15:47,000 one of the best courses at Stanford - it's going 359 00:15:47,000 --> 00:15:50,000 to be 360 00:15:50,000 --> 00:15:53,000 totally obvious when I say these things, and you guys are going to have to go 361 00:15:53,000 --> 00:15:54,000 along with it. 362 00:15:54,000 --> 00:15:55,000 I'm actually a 363 00:15:55,000 --> 00:15:58,000 big time geek, and I happen to love programming. 364 00:15:58,000 --> 00:16:00,000 That's why I'm a perfect fit for teaching this course. I have taught 106 B or 365 00:16:00,000 --> 00:16:01,000 X more than I've taught 366 00:16:01,000 --> 00:16:04,000 any other class that I've taught at Stanford in my time here, 367 00:16:04,000 --> 00:16:08,000 and that's because each quarter when we're setting the schedule, I say give me B. Give me 368 00:16:08,000 --> 00:16:09,000 X. There's no better course to teach. 369 00:16:09,000 --> 00:16:12,000 Programming is just awesome. 370 00:16:12,000 --> 00:16:15,000 If you love programming, I think there's almost nothing better to do in the world. 371 00:16:15,000 --> 00:16:18,000 You have this task. You're trying to get there. You're coding. You're making stuff 372 00:16:18,000 --> 00:16:21,000 happen. You're testing, iterating and running. You see 373 00:16:21,000 --> 00:16:23,000 stuff. You build things. 374 00:16:23,000 --> 00:16:25,000 When you're done, you know it works. 375 00:16:25,000 --> 00:16:28,000 When a 376 00:16:28,000 --> 00:16:30,000 program 377 00:16:30,000 --> 00:16:33,000 works, you know it. 378 00:16:33,000 --> 00:16:36,000 It does what it's supposed to do. It gets the right answer. It plays 379 00:16:36,000 --> 00:16:37,000 the game. It 380 00:16:37,000 --> 00:16:38,000 solves the problem. 381 00:16:38,000 --> 00:16:42,000 Finding and fixing that last bug - although debugging is one of the last 382 00:16:42,000 --> 00:16:45,000 aspects of programming a lot of people bemoan about, I happen to think that if you 383 00:16:45,000 --> 00:16:49,000 are driven by debugging, that is one of the most awesome detective stories 384 00:16:49,000 --> 00:16:49,000 ever. 385 00:16:49,000 --> 00:16:52,000 Trying to figure out why it happened when you did this, why it went this way when you moved 386 00:16:52,000 --> 00:16:54,000 that 387 00:16:54,000 --> 00:16:57,000 and what this effect caused and understanding once you make the fix how it fixes it - 388 00:16:57,000 --> 00:16:59,000 staying up late. 389 00:16:59,000 --> 00:17:02,000 I have stayed up late more nights debugging than anything else in my life, 390 00:17:02,000 --> 00:17:04,000 and I'm not sad about that at all. 391 00:17:04,000 --> 00:17:08,000 That means I'm in the right place. Hopefully, some of that resonates with you. 392 00:17:08,000 --> 00:17:10,000 If 393 00:17:10,000 --> 00:17:12,000 that sounds really awful to you, 394 00:17:12,000 --> 00:17:14,000 hopefully we can change your mind a bit. 395 00:17:14,000 --> 00:17:18,000 That is, in some ways, part of what drives computer science is this 396 00:17:18,000 --> 00:17:21,000 wanting to build things. We are engineers. 397 00:17:21,000 --> 00:17:24,000 We have this computer science name. Just remember - any subject 398 00:17:24,000 --> 00:17:29,000 that's name is something science is not a science. 399 00:17:29,000 --> 00:17:30,000 We're trying to puff 400 00:17:30,000 --> 00:17:32,000 ourselves up 401 00:17:32,000 --> 00:17:34,000 a bit. We do a lot of really great work, 402 00:17:34,000 --> 00:17:37,000 and there are a lot of neat scientific principles and theories that 403 00:17:37,000 --> 00:17:38,000 underpin what we do, 404 00:17:38,000 --> 00:17:41,000 but in the end, I think what drives a lot of us is just the engineering - 405 00:17:41,000 --> 00:17:43,000 building stuff 406 00:17:43,000 --> 00:17:45,000 that is 407 00:17:45,000 --> 00:17:49,000 really neat. It kind of reminds me that my husband's a mechanical engineer, and so I 408 00:17:49,000 --> 00:17:53,000 used to be envious, because he would always build things. He's always toting foam core 409 00:17:53,000 --> 00:17:57,000 around the campus on their paper bicycles and stuff, and it's like 410 00:17:57,000 --> 00:18:00,000 they build all these things. Now, having watched all the things he builds, it's like 411 00:18:00,000 --> 00:18:02,000 [inaudible] really hard. You need all 412 00:18:02,000 --> 00:18:06,000 these materials. You need all these tools. In 413 00:18:06,000 --> 00:18:09,000 computer science, you don't need 414 00:18:09,000 --> 00:18:10,000 415 00:18:10,000 --> 00:18:14,000 anything. You need a compiler and you need a computer. You need 416 00:18:14,000 --> 00:18:14,000 your thought. 417 00:18:14,000 --> 00:18:18,000 It's like an abstraction we built out of our brains. There's this 418 00:18:18,000 --> 00:18:20,000 relatively small set of things that you need to master 419 00:18:20,000 --> 00:18:23,000 and then you can combine them in these very sophisticated and interesting ways to solve all sorts 420 00:18:23,000 --> 00:18:24,000 of problems. 421 00:18:24,000 --> 00:18:26,000 There's a very low overhead, 422 00:18:26,000 --> 00:18:30,000 and the range of things you can attack with the same set of skills is huge. 423 00:18:30,000 --> 00:18:31,000 Every domain out there 424 00:18:31,000 --> 00:18:35,000 can benefit from somebody applying computers in a useful way 425 00:18:35,000 --> 00:18:35,000 426 00:18:35,000 --> 00:18:38,000 without fail. There's all sorts of problems where technology is part of 427 00:18:38,000 --> 00:18:41,000 the answer - not the only answer, but certainly something that you can take 428 00:18:41,000 --> 00:18:44,000 whatever interest you have and combine it with computer science 429 00:18:44,000 --> 00:18:47,000 and construct something cool. 430 00:18:47,000 --> 00:18:51,000 I happen to think that what happens in the second course is amazing. 431 00:18:51,000 --> 00:18:54,000 The first course, you've kind of got to get up to speed, and 432 00:18:54,000 --> 00:18:57,000 there's a lot of basic material that needs to get covered, 433 00:18:57,000 --> 00:19:00,000 and it does set you on the right path, but in this course, we really 434 00:19:00,000 --> 00:19:04,000 get to blossom beyond the basic things. 435 00:19:04,000 --> 00:19:07,000 There are a bunch of really neat and very accessible techniques 436 00:19:07,000 --> 00:19:11,000 that a second quarter student can understand and master and do really cool 437 00:19:11,000 --> 00:19:13,000 things with. You can learn how to do something like 438 00:19:13,000 --> 00:19:14,000 create a database 439 00:19:14,000 --> 00:19:17,000 that has a million entries 440 00:19:17,000 --> 00:19:20,000 and then ask for somebody by name and be able to instantaneously be able to find the 441 00:19:20,000 --> 00:19:23,000 name. 442 00:19:23,000 --> 00:19:26,000 Change the size of it. Make it ten million, a billion, and still be able to 443 00:19:26,000 --> 00:19:29,000 provide that kind of instantaneous access. You're going to learn how to do that. 444 00:19:29,000 --> 00:19:32,000 The technique is not some superhuman thing. It's something 445 00:19:32,000 --> 00:19:34,000 very clever, admittedly, 446 00:19:34,000 --> 00:19:36,000 but it's very 447 00:19:36,000 --> 00:19:40,000 accessible. Taking that same million thing and learning how to sort it efficiently. 448 00:19:40,000 --> 00:19:42,000 What if you happen to know things about how it's almost sorted but just a little but out of 449 00:19:42,000 --> 00:19:47,000 sorts? Are there ways you can actually make it even faster to put it in sorted order? 450 00:19:47,000 --> 00:19:50,000 There are techniques, for example, like recursion that take on problems that 451 00:19:50,000 --> 00:19:53,000 you might not have any idea when you first look at the problem how to solve, but 452 00:19:53,000 --> 00:19:56,000 once you've got your head around recursion, 453 00:19:56,000 --> 00:20:00,000 you can look at that and say I can write a five line function that will solve that 454 00:20:00,000 --> 00:20:01,000 problem. 455 00:20:01,000 --> 00:20:05,000 This is the kind of power we're going to give you with our quarter 456 00:20:05,000 --> 00:20:06,000 together. 457 00:20:06,000 --> 00:20:10,000 There's a bunch of really amazing theoretical and algorithmic stuff to 458 00:20:10,000 --> 00:20:14,000 explore that really increases the kind of things you can do with programming. 459 00:20:14,000 --> 00:20:16,000 I'm 460 00:20:16,000 --> 00:20:17,000 particularly fond of it. 461 00:20:17,000 --> 00:20:19,000 462 00:20:19,000 --> 00:20:20,000 As always, I think 463 00:20:20,000 --> 00:20:23,000 the section leading program that we have 464 00:20:23,000 --> 00:20:26,000 created and built at Stanford is a huge part of what makes our 106 465 00:20:26,000 --> 00:20:27,000 courses so successful, 466 00:20:27,000 --> 00:20:28,000 and so 467 00:20:28,000 --> 00:20:32,000 having somebody who's individually working with you, meeting with 468 00:20:32,000 --> 00:20:34,000 you weekly and 469 00:20:34,000 --> 00:20:37,000 giving you that feedback that's individualized and personalized for you and helping you get 470 00:20:37,000 --> 00:20:41,000 through the rough spots is a lot of what helps to make the experience 471 00:20:41,000 --> 00:20:44,000 very fun and very personal, too. 472 00:20:44,000 --> 00:20:48,000 What section leaders do I have here? 473 00:20:48,000 --> 00:20:49,000 Not a one. 474 00:20:49,000 --> 00:20:52,000 Where are those 475 00:20:52,000 --> 00:20:53,000 section leaders? We 476 00:20:53,000 --> 00:20:54,000 haven't 477 00:20:54,000 --> 00:20:57,000 yet identified who's going to what class, so maybe they're all 478 00:20:57,000 --> 00:21:03,000 thinking they're going to go somewhere else, but they're wrong. We'll get 479 00:21:03,000 --> 00:21:04,000 some. 480 00:21:04,000 --> 00:21:05,000 106B - great. You agree? 481 00:21:05,000 --> 00:21:07,000 Have I convinced you? 482 00:21:07,000 --> 00:21:10,000 Is anybody still hesitant? 483 00:21:10,000 --> 00:21:12,000 484 00:21:12,000 --> 00:21:13,000 485 00:21:13,000 --> 00:21:17,000 Is it a lot of work? Oh, 486 00:21:17,000 --> 00:21:19,000 no. 487 00:21:19,000 --> 00:21:22,000 Let me tell you 488 00:21:22,000 --> 00:21:25,000 a little bit about logistics. 489 00:21:25,000 --> 00:21:26,000 There are some 490 00:21:26,000 --> 00:21:30,000 random things you may want to know about how the class 491 00:21:30,000 --> 00:21:34,000 works. We're going to 492 00:21:34,000 --> 00:21:37,000 meet here Monday, Wednesday, Friday 493 00:21:37,000 --> 00:21:38,000 494 00:21:38,000 --> 00:21:43,000 2:50 to 3:05. It looks like we almost 495 00:21:43,000 --> 00:21:47,000 exactly fit in our classroom, which means we're all going to be very friendly and 496 00:21:47,000 --> 00:21:49,000 cozy. The 497 00:21:49,000 --> 00:21:54,000 lectures are being taped and are available online, and so that has the neat side effect that 498 00:21:54,000 --> 00:21:58,000 you can watch them and review them later. You could watch them lots of times. 499 00:21:58,000 --> 00:21:58,000 500 00:21:58,000 --> 00:22:01,000 It also means that if it were pouring rain and you were sitting at home in your bunny 501 00:22:01,000 --> 00:22:04,000 slippers, you could just say hey, I'm not going outside and you could 502 00:22:04,000 --> 00:22:06,000 turn on your computer and watch. 503 00:22:06,000 --> 00:22:09,000 I'm a big fan of having you come in person. That's because I don't want to 504 00:22:09,000 --> 00:22:11,000 lecture to an empty room. 505 00:22:11,000 --> 00:22:14,000 I also think there's an interaction there 506 00:22:14,000 --> 00:22:17,000 that I'm 507 00:22:17,000 --> 00:22:19,000 fond of, and so I hope that you will make every effort to attend in 508 00:22:19,000 --> 00:22:21,000 person 509 00:22:21,000 --> 00:22:25,000 as much as you can. It is nice to know that if you do miss a lecture or you 510 00:22:25,000 --> 00:22:27,000 511 00:22:27,000 --> 00:22:29,000 get caught up with something, you'll have a chance to review it later 512 00:22:29,000 --> 00:22:30,000 online. 513 00:22:30,000 --> 00:22:32,000 We will have sections that will meet once a week, 514 00:22:32,000 --> 00:22:34,000 just like 515 00:22:34,000 --> 00:22:35,000 106A. 516 00:22:35,000 --> 00:22:38,000 The section leader who meets with you is the one 517 00:22:38,000 --> 00:22:41,000 who will be grading your programs and sitting with you and doing the conferences. 518 00:22:41,000 --> 00:22:45,000 What you need to do to get yourself into a section - there are several section times 519 00:22:45,000 --> 00:22:47,000 listed. 520 00:22:47,000 --> 00:22:48,000 Ignore them. 521 00:22:48,000 --> 00:22:53,000 What you do is you go to the online - if you go to our class webpage, there's a link that tells 522 00:22:53,000 --> 00:22:56,000 you how to sign up for a section. The section times aren't up right now, but they will go up tomorrow, 523 00:22:56,000 --> 00:22:58,000 and they'll be up through the weekend. You go in and put in your preferences 524 00:22:58,000 --> 00:23:00,000 about what times fit your schedule or not, 525 00:23:00,000 --> 00:23:02,000 and there's this 526 00:23:02,000 --> 00:23:04,000 big computer program 527 00:23:04,000 --> 00:23:07,000 that gets 528 00:23:07,000 --> 00:23:10,000 everybody into a section that fits into their schedule. 529 00:23:10,000 --> 00:23:11,000 530 00:23:11,000 --> 00:23:14,000 531 00:23:14,000 --> 00:23:19,000 The signups will be up from Thursday at 5:00 until Sunday at 5:00. If by Sunday at 5:00 532 00:23:19,000 --> 00:23:22,000 you've got your schedule fixed, then you're fine. 533 00:23:22,000 --> 00:23:25,000 If you happen to change after Sunday at 5:00 and after the assignments have been made, 534 00:23:25,000 --> 00:23:27,000 at that point, it's a little bit harder. 535 00:23:27,000 --> 00:23:31,000 We can make adjustments, but it's on a very case-by-case basis. 536 00:23:31,000 --> 00:23:33,000 The best thing 537 00:23:33,000 --> 00:23:36,000 you can do is by Sunday at 5:00 have a pretty firm idea about what you can and can't do. There's a list of preferences, so maybe what you 538 00:23:36,000 --> 00:23:37,000 can do 539 00:23:37,000 --> 00:23:40,000 is pick things that you know will work no matter 540 00:23:40,000 --> 00:23:42,000 what happens. 541 00:23:42,000 --> 00:23:45,000 542 00:23:45,000 --> 00:23:47,000 543 00:23:47,000 --> 00:23:50,000 544 00:23:50,000 --> 00:23:55,000 545 00:23:55,000 --> 00:23:59,000 The workload - everybody wants to know how much work. It's a five-unit class, 546 00:23:59,000 --> 00:24:02,000 and it's a five unit engineering class. 547 00:24:02,000 --> 00:24:04,000 548 00:24:04,000 --> 00:24:06,000 You get your five units worth, 549 00:24:06,000 --> 00:24:11,000 I would say, so don't worry about that. I won't shortchange you. 550 00:24:11,000 --> 00:24:15,000 We have programming assignments not quite weekly. I think there are seven of them 551 00:24:15,000 --> 00:24:16,000 across ten weeks, so 552 00:24:16,000 --> 00:24:19,000 you can calculate it out. It's about a week and a third for 553 00:24:19,000 --> 00:24:20,000 any particular one. The 554 00:24:20,000 --> 00:24:21,000 students 555 00:24:21,000 --> 00:24:22,000 report 556 00:24:22,000 --> 00:24:25,000 that it's about a 15-20 hour project, each of them. 557 00:24:25,000 --> 00:24:28,000 Some people get them done in less than that. Some people take a little bit more. 558 00:24:28,000 --> 00:24:31,000 I would say that's kind of the 559 00:24:31,000 --> 00:24:33,000 mode range for what people are reporting. 560 00:24:33,000 --> 00:24:37,000 I do think that of the people who report less, some of those are 561 00:24:37,000 --> 00:24:39,000 people who are naturally gifted, 562 00:24:39,000 --> 00:24:41,000 but a lot of it has to do with your habits about 563 00:24:41,000 --> 00:24:43,000 how you work and how you make progress, so 564 00:24:43,000 --> 00:24:46,000 if you are one of the people who feels you might be more likely to be on the other 565 00:24:46,000 --> 00:24:49,000 end, you can come and talk to me and I can give you some suggestions. 566 00:24:49,000 --> 00:24:51,000 Choosing to work in the lair where the 567 00:24:51,000 --> 00:24:53,000 helpers are on duty 568 00:24:53,000 --> 00:24:56,000 has really positive effects in that 569 00:24:56,000 --> 00:24:59,000 when you get stuck, you have easy access to somebody helping you work through it 570 00:24:59,000 --> 00:25:02,000 rather than spending an hour or two fighting something that turns out to be 571 00:25:02,000 --> 00:25:05,000 simple but required knowing something that you didn't yet know. 572 00:25:05,000 --> 00:25:05,000 573 00:25:05,000 --> 00:25:08,000 I'm a big fan of learning things yourself. There's also a time when 574 00:25:08,000 --> 00:25:10,000 a well-placed 575 00:25:10,000 --> 00:25:14,000 bit of advice from somebody can save you a lot of time. 576 00:25:14,000 --> 00:25:15,000 577 00:25:15,000 --> 00:25:19,000 There will be a midterm and a final exam. They'll both be in class, 578 00:25:19,000 --> 00:25:21,000 579 00:25:21,000 --> 00:25:23,000 open book, open notes. The midterm is actually technically out of class. We're going to 580 00:25:23,000 --> 00:25:27,000 have it at night because we need more than a 50-minute period 581 00:25:27,000 --> 00:25:30,000 to get any coverage of that. Our final exam is scheduled in our university-scheduled 582 00:25:30,000 --> 00:25:36,000 slot. Sadly, that is at the very end of the exam week, 583 00:25:36,000 --> 00:25:38,000 but that's when the registrar put us, and that's when we need to go. 584 00:25:38,000 --> 00:25:39,000 You 585 00:25:39,000 --> 00:25:42,000 may want to take a look at that before you 586 00:25:42,000 --> 00:25:44,000 head off 587 00:25:44,000 --> 00:25:48,000 for spring break. Unfortunately, our 588 00:25:48,000 --> 00:25:52,000 publisher will not allow me to 589 00:25:52,000 --> 00:25:54,000 distribute the course reader electronically. 590 00:25:54,000 --> 00:25:57,000 They're not exactly very in the modern age on this. 591 00:25:57,000 --> 00:26:01,000 Yeah, 592 00:26:01,000 --> 00:26:02,000 I'm working on it is the truth. 593 00:26:02,000 --> 00:26:05,000 By the time the world sees this, hopefully, we will have some 594 00:26:05,000 --> 00:26:06,000 other strategy. 595 00:26:06,000 --> 00:26:09,000 We currently are in negotiations. The nice 596 00:26:09,000 --> 00:26:11,000 thing about the course reader is that 597 00:26:11,000 --> 00:26:14,000 we have not changed it in the last year. If you know somebody who has it from 598 00:26:14,000 --> 00:26:18,000 last fall or last spring, it has some minor edits and typos that were 599 00:26:18,000 --> 00:26:20,000 fixed, so if you can get a hold of an old one, it's good. 600 00:26:20,000 --> 00:26:21,000 We are 601 00:26:21,000 --> 00:26:25,000 getting no royalties on it. We're publishing it at production cost, so where it 602 00:26:25,000 --> 00:26:29,000 would have been a $100.00 textbook had it been bound 603 00:26:29,000 --> 00:26:31,000 and 604 00:26:31,000 --> 00:26:32,000 snappy, 605 00:26:32,000 --> 00:26:36,000 you're just getting what it cost to photocopy and bind the thing, and Eric and 606 00:26:36,000 --> 00:26:37,000 I are 607 00:26:37,000 --> 00:26:39,000 eating ramen. 608 00:26:39,000 --> 00:26:40,000 609 00:26:40,000 --> 00:26:42,000 It's hopefully cheap enough that 610 00:26:42,000 --> 00:26:44,000 you can find a way to get to one 611 00:26:44,000 --> 00:26:49,000 or get an old one without it being too much of an obstacle. 612 00:26:49,000 --> 00:26:53,000 People in general find the course reader to be an asset. We do say it's 613 00:26:53,000 --> 00:26:57,000 required reading. It does have a lot of material that's very 614 00:26:57,000 --> 00:26:59,000 useful in understanding the course. There are other 615 00:26:59,000 --> 00:27:02,000 people who don't make as big a use of it, 616 00:27:02,000 --> 00:27:05,000 but there are some sections that are really very valuable 617 00:27:05,000 --> 00:27:07,000 and other ones that may be more or less depending on your learning 618 00:27:07,000 --> 00:27:10,000 style. 619 00:27:10,000 --> 00:27:11,000 620 00:27:11,000 --> 00:27:15,000 There's also a lot of good sample problems 621 00:27:15,000 --> 00:27:22,000 and review questions in it that help to test your understanding. You know, it's 622 00:27:22,000 --> 00:27:23,000 tricky, 623 00:27:23,000 --> 00:27:26,000 because the university in general discourages you from giving 624 00:27:26,000 --> 00:27:29,000 alternate exams because of 625 00:27:29,000 --> 00:27:33,000 - you can imagine the issues of having an exam that has been 626 00:27:33,000 --> 00:27:35,000 seen by some number of students before some other number of students take it. Even though 627 00:27:35,000 --> 00:27:38,000 we're all bound by the honor code, it does create a situation where there is 628 00:27:38,000 --> 00:27:40,000 some temptation. 629 00:27:40,000 --> 00:27:40,000 630 00:27:40,000 --> 00:27:43,000 It's possible it could be a little bit early without a lot of gap, but I 631 00:27:43,000 --> 00:27:45,000 don't think early enough to make a lot of 632 00:27:45,000 --> 00:27:46,000 help is the truth. 633 00:27:46,000 --> 00:27:49,000 We can talk about it. The current plan 634 00:27:49,000 --> 00:27:52,000 is not, I would say. A little bit about 635 00:27:52,000 --> 00:27:55,000 compilers. We 636 00:27:55,000 --> 00:28:02,000 use C++ 637 00:28:02,000 --> 00:28:08,000 and we also use 638 00:28:08,000 --> 00:28:11,000 some custom libraries, which limits us to distributing on a certain 639 00:28:11,000 --> 00:28:15,000 number of platforms we've had a good chance to test on and work with. 640 00:28:15,000 --> 00:28:17,000 The compilers that we have 641 00:28:17,000 --> 00:28:17,000 642 00:28:17,000 --> 00:28:21,000 support for is X Code on the Macintosh. 643 00:28:21,000 --> 00:28:24,000 Anybody who has Mac OS10 can freely download that 644 00:28:24,000 --> 00:28:25,000 and install it. 645 00:28:25,000 --> 00:28:29,000 We're using Microsoft's Visual Studio Version 2005 on Windows, and 646 00:28:29,000 --> 00:28:32,000 we have an arrangement with Microsoft where they have distributed the software 647 00:28:32,000 --> 00:28:35,000 free of charge to students, so if you would like to install that on your own Windows 648 00:28:35,000 --> 00:28:36,000 computer, 649 00:28:36,000 --> 00:28:38,000 we'll give you some handouts on Friday that tell you 650 00:28:38,000 --> 00:28:42,000 what to do to get the compiler and get it installed on your 651 00:28:42,000 --> 00:28:44,000 computer. Our 652 00:28:44,000 --> 00:28:48,000 cluster computers in the dorms and the libraries and 653 00:28:48,000 --> 00:28:53,000 the lair have both the compilers and libraries 654 00:28:53,000 --> 00:28:57,000 installed, so if you work in a cluster, you don't have to do anything special. You just 655 00:28:57,000 --> 00:29:04,000 walk up and it's got the stuff ready to go. 656 00:29:04,000 --> 00:29:08,000 I'm a Mac 657 00:29:08,000 --> 00:29:11,000 person. I've been a Mac person forever. 658 00:29:11,000 --> 00:29:13,000 I can't get over the fact that you go to the start menu to shut 659 00:29:13,000 --> 00:29:17,000 the machine down. That makes Windows impossible for me 660 00:29:17,000 --> 00:29:19,000 to 661 00:29:19,000 --> 00:29:22,000 use. I would say campus wide, 662 00:29:22,000 --> 00:29:25,000 there are more Windows machines than Macs on campus, 663 00:29:25,000 --> 00:29:29,000 so if you want to take a popular vote, you could do that. 664 00:29:29,000 --> 00:29:30,000 If you want to 665 00:29:30,000 --> 00:29:34,000 be on the side of the Mac bigot, you can come and be with me 666 00:29:34,000 --> 00:29:36,000 in X Code. I've 667 00:29:36,000 --> 00:29:43,000 668 00:29:43,000 --> 00:29:46,000 got ten minutes to 669 00:29:46,000 --> 00:29:47,000 tell you 670 00:29:47,000 --> 00:29:49,000 a little bit about C++. 671 00:29:49,000 --> 00:29:54,000 That is the next journey that we're going to go on together. 672 00:29:54,000 --> 00:29:56,000 The first question is 673 00:29:56,000 --> 00:29:57,000 why are we doing this to 674 00:29:57,000 --> 00:30:02,000 you? I just got comfortable with Java and now you're telling me to throw away my Java and 675 00:30:02,000 --> 00:30:03,000 start over. 676 00:30:03,000 --> 00:30:05,000 Let's generate 677 00:30:05,000 --> 00:30:08,000 a little bit of love for 678 00:30:08,000 --> 00:30:12,000 C++. The advantages of early multilingualism - I have two small 679 00:30:12,000 --> 00:30:14,000 children at home that are two and four, 680 00:30:14,000 --> 00:30:18,000 and I read a lot about bilingualism. It's 681 00:30:18,000 --> 00:30:19,000 682 00:30:19,000 --> 00:30:22,000 very clear that for natural languages, when you're 683 00:30:22,000 --> 00:30:25,000 acquiring a language at those young ages that that is the 684 00:30:25,000 --> 00:30:27,000 best time to introduce a second or third language. 685 00:30:27,000 --> 00:30:30,000 686 00:30:30,000 --> 00:30:32,000 687 00:30:32,000 --> 00:30:35,000 It's been looked at in terms of programming languages as well, that 688 00:30:35,000 --> 00:30:38,000 when you are learning a programming language, there are certain kind 689 00:30:38,000 --> 00:30:41,000 of ruts your mind gets into about the way a language is 690 00:30:41,000 --> 00:30:45,000 that is based on your early experiences. If you spend a very long time 691 00:30:45,000 --> 00:30:47,000 working only in one language, 692 00:30:47,000 --> 00:30:49,000 those ruts get deeper, 693 00:30:49,000 --> 00:30:52,000 and you have a certain way of thinking. You're a little bit stuck in that paradigm 694 00:30:52,000 --> 00:30:55,000 and its approach. What's easy to do in that language, what's hard to do in that 695 00:30:55,000 --> 00:30:56,000 language tends 696 00:30:56,000 --> 00:30:59,000 to make a stronger impression on you in a way that makes it 697 00:30:59,000 --> 00:31:00,000 harder as you 698 00:31:00,000 --> 00:31:04,000 grow and explore the languages to kind of get out of those ruts and shake yourself out of it. 699 00:31:04,000 --> 00:31:06,000 There's been some pretty good evidence that somewhere between 700 00:31:06,000 --> 00:31:08,000 one 701 00:31:08,000 --> 00:31:11,000 and two is a good time to think about branching out 702 00:31:11,000 --> 00:31:12,000 703 00:31:12,000 --> 00:31:14,000 and starting to think about different ways of doing stuff and seeing some 704 00:31:14,000 --> 00:31:17,000 different syntax and some different ideas 705 00:31:17,000 --> 00:31:18,000 to help 706 00:31:18,000 --> 00:31:19,000 707 00:31:19,000 --> 00:31:22,000 build in the flexibility from an early age 708 00:31:22,000 --> 00:31:23,000 709 00:31:23,000 --> 00:31:26,000 in your career to buy you 710 00:31:26,000 --> 00:31:27,000 some strength later. 711 00:31:27,000 --> 00:31:31,000 That's part of what we're doing. Another part of it is actually that a lot of our upper division 712 00:31:31,000 --> 00:31:35,000 courses rely on a knowledge of C and C++, that family of 713 00:31:35,000 --> 00:31:36,000 languages, 714 00:31:36,000 --> 00:31:39,000 and that the longer we postpone it, the more painful 715 00:31:39,000 --> 00:31:42,000 it becomes. In the later courses where you're learning about 716 00:31:42,000 --> 00:31:44,000 compilers or graphics or 717 00:31:44,000 --> 00:31:44,000 networking, 718 00:31:44,000 --> 00:31:48,000 they don't have the time in those classes to stop and teach you C or C++. They need 719 00:31:48,000 --> 00:31:50,000 you to know C++ to get the work 720 00:31:50,000 --> 00:31:51,000 done. 721 00:31:51,000 --> 00:31:54,000 Moving the foundation into a programming class seems 722 00:31:54,000 --> 00:31:57,000 to make the most sense in the context of our curriculum. 723 00:31:57,000 --> 00:32:00,000 We do switch you over here. 724 00:32:00,000 --> 00:32:04,000 The good news is that it's not as big a change as it might sound at 725 00:32:04,000 --> 00:32:07,000 first glance. Java is actually 726 00:32:07,000 --> 00:32:10,000 highly derivative of C++ for a start. They're kind of cousins in the 727 00:32:10,000 --> 00:32:12,000 scheme of language design. 728 00:32:12,000 --> 00:32:14,000 They have a lot of syntax. 729 00:32:14,000 --> 00:32:16,000 How much C++ do you need to know to start? 730 00:32:16,000 --> 00:32:19,000 The answer is zero. You don't even need to know what the word means. 731 00:32:19,000 --> 00:32:21,000 732 00:32:21,000 --> 00:32:22,000 In fact, 733 00:32:22,000 --> 00:32:25,000 you actually probably know a surprising amount about C++ just 734 00:32:25,000 --> 00:32:28,000 by virtue of what you already know just translated a little bit. 735 00:32:28,000 --> 00:32:32,000 Things like the four loop of Java or the way you declare variables or 736 00:32:32,000 --> 00:32:35,000 the way parameters are passed into a function 737 00:32:35,000 --> 00:32:39,000 is exhibited in Java in very much the same way it is in C++. 738 00:32:39,000 --> 00:32:42,000 There are a bunch of things you already know and you don't even realize. 739 00:32:42,000 --> 00:32:46,000 It is not assumed that you know C or C++. If you happen to 740 00:32:46,000 --> 00:32:49,000 already know those things, you're 741 00:32:49,000 --> 00:32:51,000 ahead of the game. 742 00:32:51,000 --> 00:32:52,000 If you have not, 743 00:32:52,000 --> 00:32:54,000 then not to worry. 744 00:32:54,000 --> 00:32:57,000 How much C++ are you going to learn? 745 00:32:57,000 --> 00:32:58,000 746 00:32:58,000 --> 00:33:00,000 We will spend the first 747 00:33:00,000 --> 00:33:02,000 three or four lectures 748 00:33:02,000 --> 00:33:05,000 just talking about how things get expressed differently in C++ 749 00:33:05,000 --> 00:33:07,000 and mostly talking about 750 00:33:07,000 --> 00:33:12,000 the differences in the libraries. The syntax itself is quite similar. 751 00:33:12,000 --> 00:33:15,000 Some of the more extensive changes have to do with how the C++ 752 00:33:15,000 --> 00:33:19,000 string is operated on versus the Java string. How you do file 753 00:33:19,000 --> 00:33:20,000 input and output reading 754 00:33:20,000 --> 00:33:23,000 in C++ is a little bit different than the way it's done in Java. 755 00:33:23,000 --> 00:33:26,000 We'll spend some time saying here are some things you know how to express 756 00:33:26,000 --> 00:33:29,000 in one language. We're going to teach you how to express them in another language. It's just mapping from your 757 00:33:29,000 --> 00:33:31,000 previous 758 00:33:31,000 --> 00:33:32,000 vocabulary onto a new one. 759 00:33:32,000 --> 00:33:35,000 Along the way, we will actually introduce some of the C++ 760 00:33:35,000 --> 00:33:38,000 features that we need to support our pedagogical goals. We'll be talking about 761 00:33:38,000 --> 00:33:42,000 how classes get designed in C++. We'll see how to use classes. We'll see 762 00:33:42,000 --> 00:33:44,000 how to define 763 00:33:44,000 --> 00:33:45,000 those classes, 764 00:33:45,000 --> 00:33:49,000 and we'll look at things like templates, which is the C++ 765 00:33:49,000 --> 00:33:52,000 construct for doing generics that you seen in Java - how you can build 766 00:33:52,000 --> 00:33:56,000 containers that are type unspecific and things like that. We 767 00:33:56,000 --> 00:34:01,000 will learn a little bit of some of the fancier features of C++ like 768 00:34:01,000 --> 00:34:02,000 the pass by reference parameter, 769 00:34:02,000 --> 00:34:05,000 but there's actually a very large amount of C++ that's just off the 770 00:34:05,000 --> 00:34:07,000 table for us. 771 00:34:07,000 --> 00:34:11,000 We will not make extensive use of the standard template library or 772 00:34:11,000 --> 00:34:13,000 the 773 00:34:13,000 --> 00:34:17,000 fancier features of static and [inaudible] and a bunch of key words that 774 00:34:17,000 --> 00:34:20,000 mean nothing to you and should mean nothing to you. 775 00:34:20,000 --> 00:34:23,000 You will learn enough to have reading familiarity with 776 00:34:23,000 --> 00:34:26,000 C++ and to be able to express yourself quite well in the subset we're using, but 777 00:34:26,000 --> 00:34:29,000 it is a subset of C++ that you're being exposed 778 00:34:29,000 --> 00:34:31,000 779 00:34:31,000 --> 00:34:32,000 780 00:34:32,000 --> 00:34:35,000 to. 781 00:34:35,000 --> 00:34:39,000 If you find yourself really wanting to 782 00:34:39,000 --> 00:34:39,000 783 00:34:39,000 --> 00:34:42,000 master C++, 784 00:34:42,000 --> 00:34:44,000 785 00:34:44,000 --> 00:34:46,000 786 00:34:46,000 --> 00:34:48,000 we are offering 787 00:34:48,000 --> 00:34:52,000 CS106L. CS106L is a lab companion course that is 788 00:34:52,000 --> 00:34:55,000 open to students enrolled in 106B or 106X. 789 00:34:55,000 --> 00:34:57,000 It meets twice a week. 790 00:34:57,000 --> 00:34:59,000 It's actually on Monday and Wednesday late afternoon. 791 00:34:59,000 --> 00:35:02,000 It's 4:15 in Hewlett 792 00:35:02,000 --> 00:35:04,000 103. It's being taught by a veteran section leader 793 00:35:04,000 --> 00:35:09,000 who is very well versed in C++ and who of his own 794 00:35:09,000 --> 00:35:13,000 volition volunteered and created this course because 795 00:35:13,000 --> 00:35:16,000 he himself was a little frustrated as a prior 106 student 796 00:35:16,000 --> 00:35:19,000 in wanting to get at some of those C++ things that weren't 797 00:35:19,000 --> 00:35:20,000 fitting with our goals. 798 00:35:20,000 --> 00:35:23,000 It is a place where you can 799 00:35:23,000 --> 00:35:26,000 get more exposure to standard C++, do some exercises that help 800 00:35:26,000 --> 00:35:29,000 you to test out those things and see how those things are expressed and get another 801 00:35:29,000 --> 00:35:32,000 unit. It's a pass/fail lab course. 802 00:35:32,000 --> 00:35:35,000 You can also just attend or grab the materials if you just want to look at 803 00:35:35,000 --> 00:35:35,000 them. 804 00:35:35,000 --> 00:35:38,000 It's a great way to 805 00:35:38,000 --> 00:35:39,000 806 00:35:39,000 --> 00:35:41,000 807 00:35:41,000 --> 00:35:43,000 broaden that knowledge of C++ beyond what's 808 00:35:43,000 --> 00:35:48,000 useful for us in terms of our goals. I'm going 809 00:35:48,000 --> 00:35:53,000 to ask you some questions, because I don't get to do all the talking. 810 00:35:53,000 --> 00:35:56,000 How much C++ do you need to know? Some of you may know nothing about it, 811 00:35:56,000 --> 00:35:58,000 and that is perfectly fine. Some of you probably know something about it or at least 812 00:35:58,000 --> 00:36:02,000 have heard something about it. I'm going to have you guys tell me 813 00:36:02,000 --> 00:36:04,000 what it 814 00:36:04,000 --> 00:36:05,000 815 00:36:05,000 --> 00:36:09,000 is that people tell you about C++ that 816 00:36:09,000 --> 00:36:13,000 makes you either excited to learn it or frightened to learn it or 817 00:36:13,000 --> 00:36:15,000 interested in how it works. It's 818 00:36:15,000 --> 00:36:17,000 what Java is based off of. It is what Java is 819 00:36:17,000 --> 00:36:20,000 based 820 00:36:20,000 --> 00:36:24,000 off of. That should be a little reassuring 821 00:36:24,000 --> 00:36:28,000 that there is a syntax there that got adopted with some minor 822 00:36:28,000 --> 00:36:31,000 changes. It should feel 823 00:36:31,000 --> 00:36:34,000 more familiar than different when you look at it. 824 00:36:34,000 --> 00:36:37,000 It was very strongly influenced by a generation of 825 00:36:37,000 --> 00:36:39,000 programmers who C++ was their native language who designed the 826 00:36:39,000 --> 00:36:42,000 Java language. That's a good thing to know. What else do you know 827 00:36:42,000 --> 00:36:47,000 about C++? 828 00:36:47,000 --> 00:36:49,000 It's extended 829 00:36:49,000 --> 00:36:50,000 830 00:36:50,000 --> 00:36:53,000 C. Yes. It's extended C. Here's how it fits in the spectrum. 831 00:36:53,000 --> 00:36:56,000 C is kind of a 1970s creation. C++ is a 832 00:36:56,000 --> 00:36:58,000 decade later. 833 00:36:58,000 --> 00:37:01,000 C is the language which it is based on. It is an extended C. It's 834 00:37:01,000 --> 00:37:05,000 called a superset. Everything that compiles and works in C 835 00:37:05,000 --> 00:37:07,000 still exists in C++, but then they added a bunch of features. 836 00:37:07,000 --> 00:37:10,000 Not only did they add a bunch of features but they tried to fix some of the things 837 00:37:10,000 --> 00:37:13,000 about C++ by replacing existing things. For example, there's some 838 00:37:13,000 --> 00:37:17,000 string handling in C that's kind of very primitive. They added a string 839 00:37:17,000 --> 00:37:18,000 object 840 00:37:18,000 --> 00:37:22,000 with much cleaner handling and safer semantics into the C++, but they kind of 841 00:37:22,000 --> 00:37:23,000 left the old one around. 842 00:37:23,000 --> 00:37:26,000 Some parts of C++ feel a little strange 843 00:37:26,000 --> 00:37:32,000 because of this history to it - the legacy of incorporating everything C was plus the stuff 844 00:37:32,000 --> 00:37:35,000 means at times there's a little bit of weirdness there. It also means 845 00:37:35,000 --> 00:37:39,000 that the language, as a result, is very large. 846 00:37:39,000 --> 00:37:40,000 847 00:37:40,000 --> 00:37:44,000 C's 848 00:37:44,000 --> 00:37:47,000 safety 849 00:37:47,000 --> 00:37:52,000 and runtime features were extended by what 850 00:37:52,000 --> 00:37:56,000 got 851 00:37:56,000 --> 00:38:00,000 added in C++. A friend of mine told me that [inaudible]. That's a 852 00:38:00,000 --> 00:38:04,000 853 00:38:04,000 --> 00:38:07,000 854 00:38:07,000 --> 00:38:08,000 good thing 855 00:38:08,000 --> 00:38:09,000 to know. 856 00:38:09,000 --> 00:38:13,000 C++ might be a little bit more dangerous than Java. 857 00:38:13,000 --> 00:38:17,000 That is true. Java is very 858 00:38:17,000 --> 00:38:21,000 concerned with 859 00:38:21,000 --> 00:38:25,000 safety, in particular since Java was designed for web 860 00:38:25,000 --> 00:38:27,000 delivery of content. It was very important that the program have 861 00:38:27,000 --> 00:38:29,000 very constrained 862 00:38:29,000 --> 00:38:31,000 features on what it can and can't do, 863 00:38:31,000 --> 00:38:35,000 and so as a result, Java tends to be very parental. When you 864 00:38:35,000 --> 00:38:38,000 forget to initialize a variable or forget to 865 00:38:38,000 --> 00:38:39,000 return from a function, 866 00:38:39,000 --> 00:38:41,000 Java's 867 00:38:41,000 --> 00:38:45,000 very aggressive about saying hey, you've got to fix this. C++ is a little 868 00:38:45,000 --> 00:38:46,000 869 00:38:46,000 --> 00:38:47,000 less 870 00:38:47,000 --> 00:38:51,000 parental. Here's the overly protective mom, helicopter mom, 871 00:38:51,000 --> 00:38:54,000 the ones who stand. That's Java. Java's making sure - oh, are you okay, 872 00:38:54,000 --> 00:38:57,000 sweetie? Let me stand here 873 00:38:57,000 --> 00:39:01,000 in case you fall. C++ is crack mom. She's like yeah, I'm over 874 00:39:01,000 --> 00:39:05,000 here with my friends. Don't play 875 00:39:05,000 --> 00:39:06,000 with 876 00:39:06,000 --> 00:39:08,000 the kitchen knives. 877 00:39:08,000 --> 00:39:11,000 It's a professional's tool, 878 00:39:11,000 --> 00:39:13,000 and professionals don't want to feel encumbered. There are certain things they want 879 00:39:13,000 --> 00:39:16,000 to do that require some of this 880 00:39:16,000 --> 00:39:19,000 low-level access, and safety usually comes at a cost. 881 00:39:19,000 --> 00:39:23,000 Any sort of feature where the language is double-checking for you is taking time and 882 00:39:23,000 --> 00:39:26,000 efficiency. There's a cost associated with that. Every time you want 883 00:39:26,000 --> 00:39:28,000 to get something out of an array, 884 00:39:28,000 --> 00:39:30,000 it's checked to make sure that that number was 885 00:39:30,000 --> 00:39:34,000 not off either end. Every array access costs you a little bit more. 886 00:39:34,000 --> 00:39:35,000 C++ says 887 00:39:35,000 --> 00:39:38,000 I'm not going to charge everybody that penalty. If you actually have the bad sense 888 00:39:38,000 --> 00:39:43,000 to write a program that does those things, you deserve to be punished. 889 00:39:43,000 --> 00:39:47,000 As a result, you will at some 890 00:39:47,000 --> 00:39:49,000 point in this quarter get to experience some of that firsthand. Some of 891 00:39:49,000 --> 00:39:53,000 it is a growth experience. Some 892 00:39:53,000 --> 00:39:56,000 of it can be frustrating. It is part of what 893 00:39:56,000 --> 00:39:58,000 professional tools often look like. They are making these tradeoffs 894 00:39:58,000 --> 00:40:01,000 of efficiency over safety that 895 00:40:01,000 --> 00:40:04,000 put more of the work back on you as the programmer to be a little more attentive on 896 00:40:04,000 --> 00:40:05,000 those things. 897 00:40:05,000 --> 00:40:09,000 You can write programs that crash in very spectacular ways 898 00:40:09,000 --> 00:40:14,000 much more interesting and varied and dangerous than the kind of things you can do 899 00:40:14,000 --> 00:40:18,000 900 00:40:18,000 --> 00:40:21,000 in Java. Good to know. You want to 901 00:40:21,000 --> 00:40:29,000 use 902 00:40:29,000 --> 00:40:29,000 pointers. 903 00:40:29,000 --> 00:40:31,000 You're going to get to use pointers. 904 00:40:31,000 --> 00:40:35,000 Pointers are really neat, and they're also very challenging. Pointers are these 905 00:40:35,000 --> 00:40:37,000 ways of building these very flexible and amazing 906 00:40:37,000 --> 00:40:40,000 data structures - the kind of things that we're going to try to build. At some 907 00:40:40,000 --> 00:40:43,000 point, they are going to be the only way to achieve those things well, so building 908 00:40:43,000 --> 00:40:46,000 these things called trees, graphs and lifts rely on understanding 909 00:40:46,000 --> 00:40:49,000 a mastery of the pointer type. The pointer type is complicated, and it's part of 910 00:40:49,000 --> 00:40:51,000 that danger thing, which is 911 00:40:51,000 --> 00:40:53,000 having access to 912 00:40:53,000 --> 00:40:57,000 rearranging memory by virtue of addresses opens up a lot of 913 00:40:57,000 --> 00:40:59,000 opportunity for there to be mistakes. 914 00:40:59,000 --> 00:41:02,000 Mistakes can be made in the passive voice 915 00:41:02,000 --> 00:41:06,000 that have consequences. You'll get to experience firsthand what that's like. 916 00:41:06,000 --> 00:41:09,000 There's joy in it, because getting it right is awesome, and there are things that you can 917 00:41:09,000 --> 00:41:12,000 achieve that are really extraordinary with pointers, but 918 00:41:12,000 --> 00:41:13,000 when it's not working, 919 00:41:13,000 --> 00:41:17,000 it can 920 00:41:17,000 --> 00:41:18,000 be frustrating. You're getting a 921 00:41:18,000 --> 00:41:22,000 little 922 00:41:22,000 --> 00:41:25,000 bit of both. It turns out C++ does not have a graphics system built 923 00:41:25,000 --> 00:41:26,000 into it. 924 00:41:26,000 --> 00:41:29,000 Java is actually distinguished from previous 925 00:41:29,000 --> 00:41:32,000 languages. Java tries to solve all problems. Traditionally, a 926 00:41:32,000 --> 00:41:33,000 programming language tends to have a set 927 00:41:33,000 --> 00:41:34,000 of libraries that have 928 00:41:34,000 --> 00:41:38,000 facilities for data management, reading and writing files and sometimes some 929 00:41:38,000 --> 00:41:42,000 networking, but they don't tend to actually solve application layer problems. That 930 00:41:42,000 --> 00:41:46,000 tended to be a different piece of technology. The Mac 931 00:41:46,000 --> 00:41:49,000 OS might offer a graphics library that was written in C++, but C++ 932 00:41:49,000 --> 00:41:50,000 the language 933 00:41:50,000 --> 00:41:53,000 didn't have a windowing system or graphics system. 934 00:41:53,000 --> 00:41:55,000 C++ does not have those features 935 00:41:55,000 --> 00:41:56,000 itself, 936 00:41:56,000 --> 00:41:58,000 so any C++ compiler 937 00:41:58,000 --> 00:42:02,000 you get comes with these basic things about handling files and managing these types of 938 00:42:02,000 --> 00:42:05,000 data structures, but it does not come a priori with a bunch of graphics routines. 939 00:42:05,000 --> 00:42:07,000 That said, 940 00:42:07,000 --> 00:42:09,000 Windows and Mac and Linux and all these things have graphics routines that are 941 00:42:09,000 --> 00:42:12,000 written in C++, but they're all different. To say what are they 942 00:42:12,000 --> 00:42:13,000 like 943 00:42:13,000 --> 00:42:15,000 relative to Java? They're all different relative 944 00:42:15,000 --> 00:42:16,000 to Java. It's not standardized. 945 00:42:16,000 --> 00:42:18,000 946 00:42:18,000 --> 00:42:21,000 There's a wide variety of them out there, and 947 00:42:21,000 --> 00:42:24,000 they tend to have a lot of very impressive and different solved 948 00:42:24,000 --> 00:42:27,000 problems, because C++ has a longer history than Java that a lot 949 00:42:27,000 --> 00:42:30,000 of problems have been solved in C++ that are available to you, 950 00:42:30,000 --> 00:42:32,000 too. There's a lot of existing code 951 00:42:32,000 --> 00:42:36,000 other than what you might think is standard. 952 00:42:36,000 --> 00:42:38,000 953 00:42:38,000 --> 00:42:42,000 I 954 00:42:42,000 --> 00:42:43,000 will 955 00:42:43,000 --> 00:42:47,000 see you on Friday, and we'll be seeing some C++. If you have 956 00:42:47,000 --> 00:42:58,000 questions about your situation, come and talk to me now.