DAVID MALAN: --indeed things just
get easier in many ways to do.
So we transitioned to C--
DOUG LLOYD: So, after nine years
of CS50 and eight years of people
asking us to do Python instead of
PHP we finally made the switch.
DAVID MALAN: Yeah, it just
felt like it was time.
I mean Python has much of the momentum
in terms of web programming these days.
But you know what put
me over the edge was,
increasingly with the year have we
refined our approach to web programming
in PHP, and we gave students a bit
more framework or representative code.
We introduced MVC some
years ago, we gave them
a library to facilitate SQL
queries in recent years, too.
And this past year what I
was really inclined to do
was give them a bit more
of distribution code
for pset7, CS50 finance, that
would also handle routing,
so that routing would get handled
through some one central file,
like index.php, as is often the
case with a lot of PHP frameworks
these days.
And honestly, at that
point the closer we
got to taking over routing from the
language, which historically had been
done with individual files in
different directories and so forth,
like we did in CS50, at that point we're
really losing the advantages of PHP
and how there were so little
distance between the file system,
and the files themselves, and the
controlling role that they played.
So it felt to me, like
at that point, if I'm
going to be giving them
this much boilerplate code
and abstracting away
those details, let's
just go to where most other
people have been skating.
DOUG LLOYD: But it really
gave us an opportunity
to dig deep into the equivalent
of week eight in the past
and reinvent a lot of stuff
in terms of the staff.
A lot of the staff was
familiar with Python,
but some folks weren't, and
so it was a radical change.
DAVID MALAN: Yeah.
No, I mean I had to pick it up myself
certainly and try to map things
past to the present, figure
out what still made since,
what didn't, redo all
of the examples, think
about how we would
implement pset7 and pset8,
and so forth, but it's a wonderful--
I think it's really strengthened
this part of the course
now because Python just as
a practical matter is just
so useful in other contexts too.
I mean I really liked
this year how in pset6 we
made that no longer
C, but Python as well
to explore machine learning and
sentiment analysis, because now you
had an opportunity to use the language
at the command line too before we
transition in pset7 to web programming.
So you sort of get the
best of both worlds.
DOUG LLOYD: Yeah, we never
had the equivalent of a PHP
at the command line, which
you could do, but we never
had a problem set about it.
DAVID MALAN: And was just never
the right language for command line
scripts, like you could use
it, and I used it for years,
but it's just not really done as much.
So this was a win, and I was
nervous, because we never
made this non-trivial of a change
like ripping out the whole language,
most everything else has been
pretty marginal and incremental
like switching to SQL lite
away from MySQL for instance.
But this was impactful,
but it seemed to work well.
We got through it, and
it was a enough time.
It turns out, out of, I think
perhaps a bit of nerves,
our Python lecture was the longest,
I think, of our lectures this year.
I was just so excited to
talk about, but make sure
we really hit every mark we could.
DOUG LLOYD: But I think that
also, since you brought up pset6,
we used to have the web server which
was the final cpset, we instead as you
mentioned had a Python
command pset were also
got to reintroduce some of the
problem from pset1 and pset2--
DAVID MALAN: Yeah, which I really liked.
DOUG LLOYD: --which is a great
way to allow students to get
used to the language without having
to also solve a brand new problem.
That was only half of it, the other half
what's actually solve a new problem,
but it really took that
barrier to entry away as well.
DAVID MALAN: I agree.
But it's stuff like that I was
a little nervous about because
unlike C to JavaScript where there
really is more of a line for line map--
DOUG LLOYD: Or C to PHP.
DAVID MALAN: Or C the PHP, whose
documentation too I always loved.
I think php.net is speller and
Python's I think is less so.
DOUG LLOYD: There's no equivalent
to [INTERPOSING VOICES] that.
DAVID MALAN: It doesn't
line up quite as well.
And so it's a bit more of a
mental leap, and that's OK,
and I do think it worked well.
And it's inevitable
if students are going
to go pick up the language on
their own, so it was just perhaps
a little overly conservative for
some time, but it worked out.
DOUG LLOYD: Now in addition to
the question of PHP versus Python,
there was then the follow up question
which is Python 2 or Python 3.
DAVID MALAN: Yeah, so I did my
googling and my due diligence,
talked to some folks, and
it felt like now there's
enough momentum behind Python 3 that if
we're going to do this let's go all in
and not have to upgrade
from Python 2 to Python 3
in a year or two once we've
put out all these materials.
And the reality is, so
far as CS50 is concerned,
there's terribly few
differences between the language
that our students might encounter
so early on, print for instance
might be one such example, and there
are others they might encounter later,
but I was comfortable with that.
And there's just so many nice
new features syntactically
and also functionally in
the library that comes
with Python 3 that was compelling.
DOUG LLOYD: Yeah.
And I would say for
anybody who's watching this
and is learning Python
themselves, I'd say
that the one tip I would
give you for what I was doing
was, when you're searching for
things in Python search for Python 3
how to do something, not necessarily
Python how to do something.
It's the one catch,
but I agree, if we had
used Python 2 we would
have had to been playing
catch up probably in 2017 instead of--
DAVID MALAN: Agreed.
We leap-frogged that.
