1 00:00:00,000 --> 00:00:00,666 [VIDEO PLAYBACK] 2 00:00:00,666 --> 00:00:02,640 DAVID MALAN: --the equivalent C version. 3 00:00:02,640 --> 00:00:04,710 So guess what else we can do with Python? 4 00:00:04,710 --> 00:00:08,640 Not only can we re-implement all of weeks one through five's examples from 5 00:00:08,640 --> 00:00:12,257 C in Python, so can we implement the entirety-- 6 00:00:12,257 --> 00:00:12,840 [END PLAYBACK] 7 00:00:12,840 --> 00:00:15,900 DOUG LLOYD: That was his. 8 00:00:15,900 --> 00:00:20,220 So, much like a number of the staff, I actually had not extensively 9 00:00:20,220 --> 00:00:22,500 programmed in Python myself. 10 00:00:22,500 --> 00:00:25,770 And so I was actually sitting in the audience 11 00:00:25,770 --> 00:00:29,320 when this lecture was being filmed. 12 00:00:29,320 --> 00:00:33,290 I don't remember you doing this at this time in the lecture, though. 13 00:00:33,290 --> 00:00:38,280 DAVID MALAN: Sometimes entire blocks of material slip my mind, 14 00:00:38,280 --> 00:00:41,190 and we realize after shooting a two-hour lecture, 15 00:00:41,190 --> 00:00:44,190 oh shoot, forgot an additional example. 16 00:00:44,190 --> 00:00:46,530 And this one has actually been important, I think, 17 00:00:46,530 --> 00:00:52,110 so this is the example in which we translate problem set five in CS50 18 00:00:52,110 --> 00:00:54,840 from C to Python, the spell checking problem set. 19 00:00:54,840 --> 00:00:57,770 And the whole point, and we've done this for years in PHP as well, 20 00:00:57,770 --> 00:01:00,270 is to demonstrate just how much more quickly 21 00:01:00,270 --> 00:01:01,980 and with how many fewer lines of code you 22 00:01:01,980 --> 00:01:03,810 can implement the exact same functionality 23 00:01:03,810 --> 00:01:06,180 in a higher-level language like PHP or Python 24 00:01:06,180 --> 00:01:09,390 and to show also the price you pay, typically, 25 00:01:09,390 --> 00:01:13,320 in performance because of the overhead of interpreting the source 26 00:01:13,320 --> 00:01:14,090 code in Python. 27 00:01:14,090 --> 00:01:16,090 DOUG LLOYD: Right, because it's not pre-compiled 28 00:01:16,090 --> 00:01:17,340 so you have to deal with that step. 29 00:01:17,340 --> 00:01:19,200 DAVID MALAN: Indeed, now we're not-- yeah, exactly, 30 00:01:19,200 --> 00:01:22,280 not manually compiled as students might have with Clang, for instance, 31 00:01:22,280 --> 00:01:25,650 in the world of C. So, yes, this is a bit of movie magic. 32 00:01:25,650 --> 00:01:28,970 We might have shot this after the lecture wrapped and then went back in, 33 00:01:28,970 --> 00:01:32,220 and our team kindly sliced it in earlier. 34 00:01:32,220 --> 00:01:34,185 And no one would know this-- 35 00:01:34,185 --> 00:01:36,847 DOUG LLOYD: --but for the fact that this is CS50 explained, 36 00:01:36,847 --> 00:01:38,430 and we have a chance to talk about it. 37 00:01:38,430 --> 00:01:40,760 DAVID MALAN: Thanks for explaining that.