1 00:00:00,000 --> 00:00:00,500 2 00:00:00,500 --> 00:00:03,510 DAVID MALAN: --indeed things just get easier in many ways to do. 3 00:00:03,510 --> 00:00:04,730 So we transitioned to C-- 4 00:00:04,730 --> 00:00:10,920 DOUG LLOYD: So, after nine years of CS50 and eight years of people 5 00:00:10,920 --> 00:00:16,649 asking us to do Python instead of PHP we finally made the switch. 6 00:00:16,649 --> 00:00:18,690 DAVID MALAN: Yeah, it just felt like it was time. 7 00:00:18,690 --> 00:00:24,279 I mean Python has much of the momentum in terms of web programming these days. 8 00:00:24,279 --> 00:00:26,070 But you know what put me over the edge was, 9 00:00:26,070 --> 00:00:30,010 increasingly with the year have we refined our approach to web programming 10 00:00:30,010 --> 00:00:34,350 in PHP, and we gave students a bit more framework or representative code. 11 00:00:34,350 --> 00:00:37,610 We introduced MVC some years ago, we gave them 12 00:00:37,610 --> 00:00:42,125 a library to facilitate SQL queries in recent years, too. 13 00:00:42,125 --> 00:00:44,250 And this past year what I was really inclined to do 14 00:00:44,250 --> 00:00:46,620 was give them a bit more of distribution code 15 00:00:46,620 --> 00:00:49,980 for pset7, CS50 finance, that would also handle routing, 16 00:00:49,980 --> 00:00:52,680 so that routing would get handled through some one central file, 17 00:00:52,680 --> 00:00:56,400 like index.php, as is often the case with a lot of PHP frameworks 18 00:00:56,400 --> 00:00:57,390 these days. 19 00:00:57,390 --> 00:01:00,150 And honestly, at that point the closer we 20 00:01:00,150 --> 00:01:03,682 got to taking over routing from the language, which historically had been 21 00:01:03,682 --> 00:01:06,390 done with individual files in different directories and so forth, 22 00:01:06,390 --> 00:01:10,800 like we did in CS50, at that point we're really losing the advantages of PHP 23 00:01:10,800 --> 00:01:15,810 and how there were so little distance between the file system, 24 00:01:15,810 --> 00:01:19,860 and the files themselves, and the controlling role that they played. 25 00:01:19,860 --> 00:01:21,767 So it felt to me, like at that point, if I'm 26 00:01:21,767 --> 00:01:23,850 going to be giving them this much boilerplate code 27 00:01:23,850 --> 00:01:25,558 and abstracting away those details, let's 28 00:01:25,558 --> 00:01:27,990 just go to where most other people have been skating. 29 00:01:27,990 --> 00:01:29,989 DOUG LLOYD: But it really gave us an opportunity 30 00:01:29,989 --> 00:01:33,420 to dig deep into the equivalent of week eight in the past 31 00:01:33,420 --> 00:01:37,377 and reinvent a lot of stuff in terms of the staff. 32 00:01:37,377 --> 00:01:39,210 A lot of the staff was familiar with Python, 33 00:01:39,210 --> 00:01:42,810 but some folks weren't, and so it was a radical change. 34 00:01:42,810 --> 00:01:43,560 DAVID MALAN: Yeah. 35 00:01:43,560 --> 00:01:47,340 No, I mean I had to pick it up myself certainly and try to map things 36 00:01:47,340 --> 00:01:49,670 past to the present, figure out what still made since, 37 00:01:49,670 --> 00:01:51,856 what didn't, redo all of the examples, think 38 00:01:51,856 --> 00:01:53,730 about how we would implement pset7 and pset8, 39 00:01:53,730 --> 00:01:56,160 and so forth, but it's a wonderful-- 40 00:01:56,160 --> 00:01:59,740 I think it's really strengthened this part of the course 41 00:01:59,740 --> 00:02:02,370 now because Python just as a practical matter is just 42 00:02:02,370 --> 00:02:04,050 so useful in other contexts too. 43 00:02:04,050 --> 00:02:06,420 I mean I really liked this year how in pset6 we 44 00:02:06,420 --> 00:02:09,389 made that no longer C, but Python as well 45 00:02:09,389 --> 00:02:12,180 to explore machine learning and sentiment analysis, because now you 46 00:02:12,180 --> 00:02:15,540 had an opportunity to use the language at the command line too before we 47 00:02:15,540 --> 00:02:17,169 transition in pset7 to web programming. 48 00:02:17,169 --> 00:02:18,960 So you sort of get the best of both worlds. 49 00:02:18,960 --> 00:02:20,910 DOUG LLOYD: Yeah, we never had the equivalent of a PHP 50 00:02:20,910 --> 00:02:22,410 at the command line, which you could do, but we never 51 00:02:22,410 --> 00:02:23,250 had a problem set about it. 52 00:02:23,250 --> 00:02:25,170 DAVID MALAN: And was just never the right language for command line 53 00:02:25,170 --> 00:02:27,503 scripts, like you could use it, and I used it for years, 54 00:02:27,503 --> 00:02:30,690 but it's just not really done as much. 55 00:02:30,690 --> 00:02:32,940 So this was a win, and I was nervous, because we never 56 00:02:32,940 --> 00:02:36,270 made this non-trivial of a change like ripping out the whole language, 57 00:02:36,270 --> 00:02:40,050 most everything else has been pretty marginal and incremental 58 00:02:40,050 --> 00:02:44,705 like switching to SQL lite away from MySQL for instance. 59 00:02:44,705 --> 00:02:46,830 But this was impactful, but it seemed to work well. 60 00:02:46,830 --> 00:02:49,290 We got through it, and it was a enough time. 61 00:02:49,290 --> 00:02:52,835 It turns out, out of, I think perhaps a bit of nerves, 62 00:02:52,835 --> 00:02:57,347 our Python lecture was the longest, I think, of our lectures this year. 63 00:02:57,347 --> 00:02:59,430 I was just so excited to talk about, but make sure 64 00:02:59,430 --> 00:03:01,987 we really hit every mark we could. 65 00:03:01,987 --> 00:03:04,570 DOUG LLOYD: But I think that also, since you brought up pset6, 66 00:03:04,570 --> 00:03:08,190 we used to have the web server which was the final cpset, we instead as you 67 00:03:08,190 --> 00:03:11,790 mentioned had a Python command pset were also 68 00:03:11,790 --> 00:03:14,840 got to reintroduce some of the problem from pset1 and pset2-- 69 00:03:14,840 --> 00:03:16,506 DAVID MALAN: Yeah, which I really liked. 70 00:03:16,506 --> 00:03:19,590 DOUG LLOYD: --which is a great way to allow students to get 71 00:03:19,590 --> 00:03:23,102 used to the language without having to also solve a brand new problem. 72 00:03:23,102 --> 00:03:26,310 That was only half of it, the other half what's actually solve a new problem, 73 00:03:26,310 --> 00:03:30,655 but it really took that barrier to entry away as well. 74 00:03:30,655 --> 00:03:31,530 DAVID MALAN: I agree. 75 00:03:31,530 --> 00:03:34,071 But it's stuff like that I was a little nervous about because 76 00:03:34,071 --> 00:03:38,760 unlike C to JavaScript where there really is more of a line for line map-- 77 00:03:38,760 --> 00:03:39,960 DOUG LLOYD: Or C to PHP. 78 00:03:39,960 --> 00:03:43,740 DAVID MALAN: Or C the PHP, whose documentation too I always loved. 79 00:03:43,740 --> 00:03:46,915 I think php.net is speller and Python's I think is less so. 80 00:03:46,915 --> 00:03:49,540 DOUG LLOYD: There's no equivalent to [INTERPOSING VOICES] that. 81 00:03:49,540 --> 00:03:51,250 DAVID MALAN: It doesn't line up quite as well. 82 00:03:51,250 --> 00:03:53,580 And so it's a bit more of a mental leap, and that's OK, 83 00:03:53,580 --> 00:03:54,870 and I do think it worked well. 84 00:03:54,870 --> 00:03:56,578 And it's inevitable if students are going 85 00:03:56,578 --> 00:03:59,310 to go pick up the language on their own, so it was just perhaps 86 00:03:59,310 --> 00:04:02,152 a little overly conservative for some time, but it worked out. 87 00:04:02,152 --> 00:04:04,860 DOUG LLOYD: Now in addition to the question of PHP versus Python, 88 00:04:04,860 --> 00:04:09,290 there was then the follow up question which is Python 2 or Python 3. 89 00:04:09,290 --> 00:04:12,720 DAVID MALAN: Yeah, so I did my googling and my due diligence, 90 00:04:12,720 --> 00:04:15,420 talked to some folks, and it felt like now there's 91 00:04:15,420 --> 00:04:18,810 enough momentum behind Python 3 that if we're going to do this let's go all in 92 00:04:18,810 --> 00:04:21,690 and not have to upgrade from Python 2 to Python 3 93 00:04:21,690 --> 00:04:25,120 in a year or two once we've put out all these materials. 94 00:04:25,120 --> 00:04:27,120 And the reality is, so far as CS50 is concerned, 95 00:04:27,120 --> 00:04:29,328 there's terribly few differences between the language 96 00:04:29,328 --> 00:04:32,336 that our students might encounter so early on, print for instance 97 00:04:32,336 --> 00:04:35,460 might be one such example, and there are others they might encounter later, 98 00:04:35,460 --> 00:04:37,140 but I was comfortable with that. 99 00:04:37,140 --> 00:04:40,140 And there's just so many nice new features syntactically 100 00:04:40,140 --> 00:04:42,714 and also functionally in the library that comes 101 00:04:42,714 --> 00:04:44,130 with Python 3 that was compelling. 102 00:04:44,130 --> 00:04:44,430 DOUG LLOYD: Yeah. 103 00:04:44,430 --> 00:04:46,530 And I would say for anybody who's watching this 104 00:04:46,530 --> 00:04:48,600 and is learning Python themselves, I'd say 105 00:04:48,600 --> 00:04:51,490 that the one tip I would give you for what I was doing 106 00:04:51,490 --> 00:04:54,974 was, when you're searching for things in Python search for Python 3 107 00:04:54,974 --> 00:04:57,640 how to do something, not necessarily Python how to do something. 108 00:04:57,640 --> 00:05:00,550 It's the one catch, but I agree, if we had 109 00:05:00,550 --> 00:05:03,880 used Python 2 we would have had to been playing 110 00:05:03,880 --> 00:05:06,067 catch up probably in 2017 instead of-- 111 00:05:06,067 --> 00:05:06,900 DAVID MALAN: Agreed. 112 00:05:06,900 --> 00:05:09,200 We leap-frogged that. 113 00:05:09,200 --> 00:05:10,473