DAVID MALAN: All right, welcome to computer science 50,
introduction to computer science 1.
My name is David Malan, and I will be your instructor this semester.
So even if you have no idea how the computer you own,
or the laptop you own, works--
and perhaps some of you are just a little bit scared of it-- you probably
know at the end of the day, everything that goes on inside that computer
boils down to zeros and ones, a.k.a.
bits.
So where are all these zeros and ones stored?
Well, you probably also know that inside your computer somewhere is
this thing called a hard drive, whether you have a desktop,
you'll have something like this, a laptop,
you'll have something like this.
But mechanically, they pretty much work the same.
In fact, in some of your iPods, or devices much like these--
quick question, how do these things work?
This is literally like a 200 gigabyte hard
drive that I pulled from a non-functioning desktop computer.
What goes on inside these things?
Well, as you can kind of tell-- and I'll start passing this around--
there are these things called platters.
Essentially, these metal disks inside of hard drives
that have millions, billions of tiny magnetic particles on top of them.
And essentially, if you align these magnetic particles,
say north-south, we might say that that particle is simply representing a 1.
By contrast, if you flip that magnetic particle
over putting it south to north, well we might say that particle is essentially
representing a 0.
And it's certainly a bit more complicated than that,
but at the end of the day, the storage of zeros and ones--
the so-called language of computers-- all boils down to-- on hard drives,
at least--
the storage of these magnetic particles.
Well, it turns out that these larger devices are much like these floppies,
that probably most of you in this room don't even use anymore,
and most of your computers probably don't even come with them.
But go ahead and very carefully slide this little silver metal piece--
if you took a floppy on your way in-- and you can sort of see
just part of one of these circles.
This one is in fact floppy, as the name of the disks implies.
But it functionally works almost exactly the same as the hard drive.
So let's go ahead and turn our attention for a moment to little video-- granted,
a cheesy video-- but nonetheless, a bit illustrative.
[VIDEO PLAYBACK]
- [INAUDIBLE] works with 3 and 1/2 inch floppy disks.
DAVID MALAN: Let's not, actually.
[VIDEO PLAYBACK]
- The floppy drive you see here--
DAVID MALAN: All right.
What a perfect way to begin today.
[LAUGHTER]
- They're the type most often used to carry new programs.
DAVID MALAN: I'm the only one that doesn't see
where this program is actually running.
[LAUGHTER]
[VIDEO PLAYBACK]
- See it's actually just a hard plastic--
DAVID MALAN: There we go.
All right, it opened the wrong part.
Wow, it makes you want to start this lecture all over again, huh?
All right, let's go ahead and play it with the right software this way.
And here we go.
[VIDEO PLAYBACK]
- The floppy drive you see here works with 3 and 1/2 inch floppy disks.
They're the type most often used to carry new programs, same data,
or a new file from one PC to another.
So part of the disk we see is actually just a hard plastic shell.
The working disk, which is inside, is protected by a sliding metal shutter.
This thin, inner disk, called the cookie,
is coated not with chocolate chips,
[LAUGHTER]
--layer of magnetic material.
When you slip the disk into your floppy drive, a system of levers
pushes back the metal shutter.
The levers also pinch to read/write as closer so they almost touch the cookie.
A motor at the base of the drive spins the cookie
based on commands from your PC.
The PC also signals another motor to move the read/write heads
back and forth over the surface of the disk so they can read or write data.
Before your PC writes data, your drive first
checks the write protect tab of the corner of the floppy disk.
If it is open, light from a tiny diode shines through
and strikes a diode on the other side.
This diode then says to your PC, go write on this disk.
[LAUGHTER]
But if the tab is closed, no light gets through,
and the PC knows it's OK to write data.
[END PLAYBACK]
DAVID MALAN: All right, so admittedly, it's a little embarrassing
even showing you that video.
I have never once, other than this man's voice,
heard the thing inside of this thing referred to as a cookie.
[LAUGHTER]
But nonetheless, let's go ahead and do the following.
Ultimately, this course is about tearing apart conceptually, a lot of which
is currently unfamiliar to you.
Go ahead-- watching out for your neighbors eyes,
though, since there's a little spring in these things--
and just go ahead and pull off the metal tab
that you slid over just a moment ago.
So now you can actually push your finger against that little floppy disk,
so to speak.
And let's take this one step further, if only for the sake of drama here.
Go ahead and insert your fingers wherever it seems possible,
and just take the plastic cover off this thing,
and literally take out the so-called floppy disk.
I know, right?
So pretty underwhelming once you actually get inside there.
But that's exactly the takeaway.
Underneath all of this technology, at the end of the day,
are fairly simple things.
You can't see these magnetic particles.
But if you do go ahead and wipe your fingers across this disk,
you've certainly hurt or corrupted any of the data that might, in fact, have
been on these floppies.
[LAUGHTER]
But again, the takeaway is just the simplicity of it all.
And those of you who are sitting in this room thinking
that, computer science is perhaps not for you, technology in general
has never been for you, just realize that all of this stuff
has been man made over the years.
And at its core, some of these things are fairly simple.
It's just that we have 30, 40 years of technology
built on top of some of these simplest technologies to get us to the point
where we are today.
Just to make this a bit more technical now--
and this is not an electrical engineering course by any means,
especially as this topic is about to be introduced by this same voice
again-- let's just take a look at exactly how these here
magnetic particles are, in fact, aligned in the spirit of ones and zeros.
[VIDEO PLAYBACK]
- To write data on your floppy disk, your PC
tells the drive to send tiny pulses of electricity through the head.
The pulses make the head act like little electromagnets.
Each head creates a magnetic field that reaches the surface of the disk.
Remember the magnetic coating on the cookie?
The magnetic field alters the tiny particles in this coating.
Its current runs through the heads one way.
The particles are arranged at the north and south poles in one direction.
But if current flows through the head the opposite way,
the polarity reverses.
To read data from the disk, the read/write
heads move into the same position over the cookie.
But this time, the process is reversed.
The cookie particles create a magnetic field in the coils of wire,
and this creates a current in the read/write head.
The disk drive detects this flow of electricity and passes it onto the PC.
The PC translates the back and forth current changes
into a series of ones and zeros, the binary language of computer data.
[END PLAYBACK]
DAVID MALAN: OK, so at the end of the day,
it just boils down to the magnetization of these particles.
You get zeros and ones.
But let's ask the more interesting question now.
Who cares?
So suppose you do have this ability to store nothing other than zeros
and ones inside of a computer.
Well why is that, in fact, even useful?
Well, it turns out-- as this woman's voice now
suggested-- that using the so-called binary alphabet of zeros and ones,
you can represent any possible number.
We all speak the so-called decimal system--
0 through 9, and then combinations thereof.
Computers only speak binary combinations of zeros and two.
So let's take a moment here-- and for those unfamiliar--
teach you how to count, not in decimal--
1,2,3, 4,5,6, 7,8, 9, 10-- but instead, in binary.
And I'll toss a softball out there.
If all you have in the world are zeros and ones, just take a stab at it.
How would you go about representing the decimal number we know as zero?
AUDIENCE: Zero.
DAVID MALAN: OK, so not a hard class thus far.
So in fact, it's true.
So it's just all zeros.
So you often hear of zeros and ones talked about in terms
of turning something on--
a one, turning something off.
A zero, like a light bulb is on, might represent a one.
A light bulb is off, it might represent a zero.
Often intertwined in that kind of conversation
is mentioned of fairly technical things like transistors,
which are nothing more than switches that turn something
on or turn something off.
So we might represent 8 bits--
that is 8 zeros and ones-- by say, these light bulbs here.
And if all eight of those bulbs--
a byte, B-Y-T-E of bits, if you will-- if are all set to off,
well that number there is simply representing zero.
Now take another stab.
If you have only zeros and ones in the world,
how do you go about representing the number one?
AUDIENCE: One.
DAVID MALAN: All right, so again, not all that non-obvious.
All the things to the left are just like the leading zeros.
You could put as many zeros to the left of a decimal number as you want,
but 00123 is still the number we know as 123.
Same in this case.
We've got 8 bits, but we only needed one of them, so that's fine.
The rest are assumed to be zeros.
Well, how do you count up from there?
Well, then you start toggling these bits, so to speak.
You turn one off.
You turn the next one over to the left on.
How would you go now to the number three?
Well, take a guess.
If we've now got represented on the board zero, one, two, intuitively,
what's probably the pattern here?
AUDIENCE: One, one.
DAVID MALAN: So one, one.
Just flip on the bit that's still off.
And so now we have one, one.
So now, we're sort of in this situation where,
if we want to represent the number four, we can't just
use those two right most bits, because it
looks like the biggest number we can represent
with just two light bulbs, two bits, looks like the number three.
Well, how do we go about making room for the number four?
Well, take a guess.
What do we do with these bits to get to the decimal number four?
AUDIENCE: [INAUDIBLE]
DAVID MALAN: So turn off those two, but flip the next one on.
So now we have light bulb on, light bulb off, light bulb off.
Now how do you actually-- and just to make this more real, here's the before.
Turn those light bulbs into zeros and ones after.
So before, after.
What you have here is what we simply know
as bytes of bits in the binary system.
So what's really the pattern here?
Well, as you might have noticed that the top row of this little chart,
there's these column headers, which I've labeled
the ones column, the twos column, the fours column, the eights column.
There's clearly a pattern there-- multiples of two
going on up from right to left.
But why are those placeholders actually useful?
Well, take note of say, this last row of bits that we have here.
One, zero, zero.
Well, why does that represent what we know as the decimal number four?
Well, take a look.
In the fours column, we have a one.
So that's like 4 times 1 is 4.
So plus a 0 in the twos column, a 0 in the ones column,
and so the additive sum is just 4.
You use that same logic for the number three.
So for the number three, in the second to last row,
we had nothing in those 128s through the fours columns.
But in the twos column and the ones column, we had ones.
So we have one 2, plus one 1 gives us the decimal number we know as three.
And just to make this more clear, this is not wholly unfamiliar to us.
If you consider what we know as the decimal number 123 from grade school,
why is that the decimal number 123?
Well, recall the same system, the same trick.
We had the ones place, we had the tens place, we had the hundreds place.
So why is this 123?
It's one 100, plus 2 times 10, plus 3 times 1, gives us what we know as 123.
So this idea of binary, or base 2, as it might be known,
is not so foreign to you.
It's simply all you have at your disposal, ultimately,
is just two values, zeros and ones.
Where as, from grade school onward, we've
been used to having 10 digits at our disposal, 0 through 9.
So with that said, a little application of knowledge, just learned perhaps--
Cambridge's zip code is 0 2 1 3 8.
If you're a freshman and don't know that yet, you will soon.
0 2 1 3 8--
what is that in binary?
Granted, the easiest way to answer this is skipping ahead
in your lecture notes, but there are dashed lines here
for your intellectual stimulation.
0 2 1 3 8 is what in binary, from top to bottom row?
All right.
The solution is now on the board.
Hopefully, the first row, everyone got zero, all zeros.
One, similarly pretty easy, because we just did that a moment ago.
But hopefully your answers check up against this.
Turns out, the only value we haven't already seen on the board
is that eight.
Well, why does that work?
Well, one, zero, zero, zero on that last row is obviously one 8, plus zero 4s,
plus zero 2s, plus zero 1s.
All right, that's it.
That is all there is to binary, to the so-called zeros and ones
that only computers speak.
And sad to say is perhaps, aspiring computer scientist, you
can now appreciate the, dare say, humor of such comics as these.
Yeah, if you're laughing you belong in computer science perhaps.
[LAUGHTER]
So, all right, so that's all fine and good.
You can represent number 0 through 8 certainly, and beyond,
if we just keep using more and more of these bits, more
and more of these zeros and ones.
But that's not all that useful when computers today don't obviously
just calculate numbers.
They have graphics and they display characters of text.
They allow you to write documents.
Well, it turns out-- and we'll revisit this later in the course--
that computers are as sophisticated as they are today
because they use those zeros and ones, this trivial alphabet of zeros
and ones, to represent any possible types of data, including, for instance,
alphabetical letters.
So this chart-- scary or overwhelming as it might seem now--
is simply a mapping, using what's called the ASCII coding system, where
in the right hand columns that are each in red,
you have some familiar characters in red.
These are like characters on the keyboard.
So you have A through A in lowercase--
A through Z in lowercase, A through Z in uppercase,
a whole bunch of punctuation.
And then next to each of those red characters,
you essentially have the numeric codes that computers traditionally
used to represent those values.
So with that said-- and the left most column under dec just means decimal--
what is the decimal value that a computer uses to represent internally
the letter capital A?
AUDIENCE: 65.
DAVID MALAN: All right, so 65.
And how about lowercase A?
AUDIENCE: 97.
DAVID MALAN: 97.
OK, if you take away no two other numbers from this so-called ASCII
coding system two weeks from now in a forthcoming problem,
know that by just remembering 65 and 97 turns out
you can remember 50 other additional characters, as well, because they're
all obviously linearly increasing.
So that's it for today.
That's the hardcore Introduction to zeros and ones, binaries,
how computers speak.
What then is this course all about?
So here's the deal.
CS50 certainly has a reputation, and it has for 10,
20 or so years since it's been around, even if some of its prior forms.
I, myself, was an undergrad in '95 to '99,
and I was a gov major for the first year and a half that I was here.
And I certainly came into this school as sort
of a geek, the kind of kid who, I heard it up here,
might have laughed at like the fox trot cartoon once I knew binary.
[LAUGHTER]
But even so-- and I was a UA at the time, too--
even so, CS50 had this reputation that I think
it's still, to a large extent, has today, which
is that it takes a lot of work.
It's really hard.
It's really only for those computer genius friends of yours.
Or in any case, it has a reputation that I think is much larger, much scarier,
than say, the course actually is itself.
And just on a whim really, or finally come sophomore year,
I had some additional confidence perhaps, and I decided,
all right, what the heck.
I'll take CS50.
I know I like this kind of stuff.
I'll just ignore all of the sort of advice
that my friends have given me to the contrary.
I took the course pass/fail up until the last possible day
when you could switch to a letter grade.
And for me, the change was simply because, for the first time,
in really of any of the courses I had taken thus far as an undergrad-- like,
I love this stuff.
And it was the first time for me-- and you can make fun of me for this
in subsequent classes--
it was the first time for me that homework honestly was fun.
And there was this coincidence of sort of my interest
sort of on an extracurricular level--
and though, I did other things besides computers extracurricularly--
and what actually was assigned work.
And this is absolutely more of a commentary on perhaps my social life
at the time than on computer science 50--
[LAUGHTER]
--but I used to look forward, frankly, to sitting down on Friday
night, and tackling the newest problem sets.
And that, too, is worthy of making fun of me for in the future.
But this is only to say that this course certainly
has personal significance to me.
And all of these folks you see sitting here in these blue t-shirts--
the teaching fellows, who I'll introduce again in a bit--
really feel passionately about this course.
For me, it really turned me on to an academic field, and ultimately
a degree program, that I just had no idea I would take such an interest in.
And the funny thing is, these days, last year,
the past five years, most of you in this room
are certainly not going to become--
certainly, as a result of this class-- computer science majors.
In fact, CS majors constitute the significant minority
of the students in CS50 these days, because rather, we
have students taking this class as an elective,
as a related field requirement for their own concentration.
And the fact of the matter is, because this course really
is sort of a side effect, or as a framework for introducing computer
science, teaches you programming.
Honestly, the rewards of a course like this, an introductory course
in computer science, really are huge in that they really
can be applicable to your own field, whether you're a science
major, whether you're a math major, whether you're simply involved
in a student group and need to actually use
computers to use websites to actually make your lives easier,
and automate some processes.
So just realize that the takeaways from this course
are far more than I think than can be conveyed in this fairly arcane language
that you see in the course catalog.
Frankly, you read this description, and it doesn't
sound like the course for most people.
But if you dive deeper into the syllabus, the course's website,
conversations with these folks here who have all taken the course,
hopefully you'll realize that this course is not
what its reputation perhaps makes itself out to be.
So with that said, what are the expectations
of students who do, in fact, take this course?
Quite simply, attend all lectures and sections, complete eight problem sets,
take three quizzes, produce a final project.
A popular question to address at the start of the term
is is there a final exam?
And the answer is no.
Grades are computed and will be weighted as follows.
Essentially, the breakdown will be as such-- this is elaborated on
in the syllabus.
But realize, because this course is certainly a lot of work,
it does have this reputation.
And I should make this point clear.
Undoubtedly, computer science 50 comes with a non-trivial workload.
And by that, we mean 10 plus hours a week, 10, 15 hours a week.
For many of you freshmen in the room, that sounds like a scary lot of hours.
Hopefully, if you're sophomore, junior, senior, or beyond,
you realize that, ha ha, 10 hours, that wasn't so bad back in the day.
So just realize that your--
[LAUGHTER]
--perception of courses and course loads, I do think, changes over time.
And just to give you the extreme counterpoint,
perhaps to scare you out of computer science
altogether-- when I took computer science 161, operating systems,
when I was in undergrad, that course, by contrast-- and it's an elective.
You don't have to take this course-- was about 40 hours a week every other week.
So that's sort of the other extreme, and that explains my Saturday nights,
as well, that semester.
[LAUGHTER]
So with that said, the course definitely comes with its own workload,
a non-trivial amount.
But the thing is, you're not going to learn computer science.
You're not going to learn how to program listening to a guy like me up here,
or even listening to your teaching fellow once a week.
It's only in sitting down in front of your own machine
and actually solving problems, fighting with the computer,
making it do what you want it to do, and getting your programs to work,
that you really exit with a new skill set.
So it is simply par for the course, frankly, putting a lot of time
into a course like this.
But again, what you get out of it, hopefully, is the ability to one,
solve problems in ways that your peers simply cannot, without say,
even that skill of programming alone, and honestly, at speeds that others,
including yourself as of now perhaps, could not solve those same problems
that computers facilitate precisely those kinds of solutions.
However, because there is a lot of work and we certainly
appreciate that we all have occasional bad days or weeks,
you will be able to drop your lowest problem set.
You'll be able to drop your lowest quiz score.
And there's a great deal more infrastructure
in place of support structure for you throughout the semester.
You may, as I started two years ago, take the course pass/fail,
simply come up to me or one of the teaching fellows to discuss as much.
But we are fine, certainly, with that.
The course's website will contain much of what you need
to succeed or to review in this course.
We'll defer a walkthrough of salient features in the future.
For your keystroke saving convenience, you can also just
type CS50.org these days, and it will redirect you
to the FAS address, which is a little harder to remember.
The email address for the staff on which I and all the teaching fellows are,
is simply cs50@fas.
But one of the features of this course that, over the years,
has proved rather popular, if only because of its anonymization of posts
and its 24 hour accessibility, is the so-called bulletin board
on the course's website.
You're presumably familiar with this concept.
The bulletin board will be accessible in about a week's time.
But we do urge you throughout the semester
to post your questions anonymously to this bulletin board
so that you certainly might benefit from an answer
from fellow students or ourselves, or certainly, other students
can benefit from the same.
All right, books-- there are four at the Coop, all of them
unreasonably expensive.
Here's the deal with the books.
So there are no required books for this course.
These days, I'm not really a fan of coercing students to buy books,
particularly because of their cost.
The course is not designed around using a specific textbook.
However, we did go ahead and recommend any of four books as follows.
Essentially, with the trend that this course fights over years
is to balance as effectively as possible those students coming
into this course who are very comfortable with computers,
maybe took AP Computer Science, and are here
really to fill in holes in their knowledge
so they can move to higher level courses.
And then there's the other type of student,
who is genuinely scared of their computer,
or feels that they should know something about programming or computer science,
but just generally feels that they are not quite at the same skill level
as say, some of the students in their sections.
So to accommodate these two different sort of unofficial tracks
within the course, one approach that we've taken this year
is to recommend either of two books.
Essentially, the way we've spun these is as follows.
This is a recommended book in the syllabus
for quote unquote those less comfortable with either computer
science, computers, with the idea of programming.
By contrast, this book is what we recommend for those more comfortable,
those of you who have maybe had some programming experience,
or even if you haven't, just feel like you're going to be fine in this course.
This is more at your level.
Effectively, these two books in particular
are designed to be at home supplements to lectures and sections.
If you are simply the type of student who learns well from reading books,
if you enjoy sort of the crutch that having a book by your side sort of
brings after lectures or adjourn, then by all means,
flip through either of these two texts.
Bye one of them, or perhaps, just take a look at it in the library.
Though I would urge any of you, if you go
this route of buying any of the books, follow the link on the course's website
to say, Amazon, and you can get these books significantly discounted.
You will not need them for at least a week or two,
so you certainly won't be at a disadvantage placing a super saver
order sometime this week.
This book here is bundled at a discount, quote unquote, at the Coop.
[LAUGHTER]
I probably shouldn't really say all these things on film these days,
but so be it.
[LAUGHTER]
This is just a lot of fun, this book.
This book is in the spirit of those, granted, cheesy videos that we showed
just a bit ago in that it's essentially--
a picture book is the wrong word, because it's more technical than that--
but it's very easily digestible.
And it addresses things like how does RAM
work, how does a hard drive work, how does a joystick work,
how does Mac OS boot up at startup.
It's very bite-sized kinds of topics that, if you just
like to sort of know a bit more about computer and the internet,
it's an interesting book to reference.
And laced throughout the problem sets this semester will be sort of one
liner questions like, how does a hard drive work.
And two, this book, you can turn-- will let
you turn to like, Wikipedia and Google in general,
for those kinds of questions.
But really, the purpose of this book in the course
is really just to encourage you to dabble in some useful knowledge,
but that certainly isn't aligned with the academic spirit of the course.
Finally, for those handful of you who might consider yourself
to be, or want to be, hackers--
a wonderfully esoteric book is this Hacker's Delight.
You find it perhaps advantageous for a couple of the courses problem
sets this year.
But really, this is a good reference book for those of you
who know you're going to be computer scientists, or really
intense programmers.
It's a wonderful book as to how to optimize, that is, improve
your own code.
And I found this a wonderful reference in graduate school
when a lot of the challenges at hand were not just getting things to work,
but getting them to work better than existing solutions,
getting them to work faster.
So as with a lot of the courses here at Harvard, ours, too,
comes with sections.
And if I could draw attention to you guys,
if you wouldn't mind standing for just a moment.
Among our course's teaching fellows are those here
in the stylish, blue t-shirts today.
You will see these in the basement of the Science Center
whenever one of these guys is on duty during office hours,
though I suspect as semester progresses, they'd
much rather you recognize their faces than these t-shirts.
So look at them now.
These folks will be holding sections, which are 60 to 90 minute sections once
a week.
They won't start until next week.
We won't officially do sectioning until next week.
So the first week of sections next week will just be "come as you are."
Attend any of the available sections, so no rush on that.
Thank you guys very much.
Let me also draw your attention in back to Katie and Thomas, the course's head
teaching fellows.
These guys are together, as a pair, responsible for managing the course
administratively.
They are a wonderful liaison to the course,
if you feel more comfortable speaking with either of them.
If, perhaps, you'd like to discuss your own teaching fellow
and how section's going with someone else or myself,
just know that these two here are a wonderful resources, as well,
and will be responsible for taking care of sectioning in a week's time.
So this is, again, a course with a good amount of challenges with it.
So what we will be offering in addition to these traditional sections
is what we've dubbed "super sections," once per week.
Essentially, these are sections that students from any individual section
are welcome to attend optionally.
They'll be led by one or more teaching fellows,
and they'll cover the same material from the week from lectures and sections,
but usually with different examples, from a different person's perspective.
So these super sections, which will also be filmed and put online,
are designed really, for those of you who are feeling uncomfortable
in the course throughout the semester, who
feel like you benefit from hearing things multiple times,
and just generally want more of a support structure in place
for yourselves.
These are purely optional, but they do exist to facilitate your success,
and really lowering your level of stress in a course like this.
In addition, office hours are a traditionally very popular aspect
of this course.
Now, I know this photo makes you almost want to go to office hours
in this very Utopian kind of place known as the Science Center.
Once you get to the basement, it doesn't look so green and fun anymore.
[LAUGHTER]
But a very popular, and a very common memory of this course,
is, in fact, the time students spend alongside the teaching
fellows in the so-called terminal room, room B14 of the Science Center.
It's down the stairs, take a left.
It's got a bunch of Linux computers these days, Macintosh computers, PCs.
And essentially, we hold weekly office hours for many hours a week
down there, so that you can really have some one on one,
hands on assistance with the current problem set, or most anything else.
Also this year, what we will be offering on an experimental basis--
is what The Crimson apparently broke the story this morning
before we even had a chance to announce it--
the virtual office hours.
So thanks to technology, not only will we
be able to help you in the basement of the Science Center one on one,
we'll also be offering what we dubbed "virtual office hours" in the course's
virtual terminal room this year.
Essentially, what this will mean is that you from your laptop or desktop
computer, whether you're in your dorm room,
whether you're away on vacation perhaps, or whether you're at brain break
in the dining hall, you can log in to what's effectively, a fancy chat room,
that has not only the ability for teaching fellows, a.k.a. moderators,
to chat with you, either via text based instant messaging interface, or even--
though I think this is of questionable efficacy--
VoIP, voice over IP, using microphones.
You can communicate in two ways with your teaching fellow privately,
but we can also share control of, and observe your own screen.
So you can think of this sort of like CS50's tech support with problem sets.
You'll be able to stay in your dorm rooms.
We'll be able to stay in our dorm rooms or homes,
and nonetheless, meet online to assist you with these problem sets.
It will be up to you guys to really dictate
where we allocate our resources-- more to the traditional Science Center
office hours, or more to these virtual office hours.
You are as much a part of this experiment
as we are over the course of the semester.
So we'll demonstrate that in a future lecture,
and let you loose on it for the course's first problem set.
So administratively, are there any questions
before we survey the material and such that you'll
be exposed to in this course?
Anything at all?
Yes?
AUDIENCE: How long are these problem sets?
DAVID MALAN: How long is each problem set?
I would say a typical student spends about 10 hours, maybe 15 hours, maybe
five hours, on a given problem set.
And there are eight of them spread over roughly 13 or 14 weeks of the semester.
Other questions?
No?
OK, as with several courses here these days, this course
is and will be filmed throughout the semester.
Usually within 72 or 96 hours, videos and quick time formats,
flash formats, NP3 formats, will be posted online via the course's website
in the form of a podcast, and also in the form of the web page itself.
So you can tune in that way.
Tonight's lecture, for instance, if you have to duck out early for shopping,
periods should be online around midnight or so tonight,
and the same will be true with a 96 hour window in future lectures.
It's also my philosophy with lectures and such that it is more
of a distraction than anything-- certainly, for students like myself--
to be constantly scribbling notes for a 60 minute or a 90 minute lecture.
Really, to the detriment, I think, of the intellectual experience
of sitting in on class, and engaging, dare say, with the person
at the podium who's asking and answering questions.
So toward that end, one of the additional pieces of support structure
we'll provide you with this semester, thanks to the teaching fellows,
will be a canonical set of scribe notes, so
to speak, whereby one of the teaching fellows each lecture will
be responsible for producing an official, if you will,
set of lecture notes that are not meant to take the place of your own notes
that you might want to take.
But are meant to alleviate you of the mental obligation, or the inclination,
or the stress, of trying to scribble down absolutely everything that
may be said, particularly when I or when lectures
themselves tend to go a bit quickly.
So know that, in addition, that support structure will be in place for you.
So with that said, any questions?
So what's on the agenda for the next several weeks?
Well, in the course's first week, namely this Wednesday and Friday,
will we introduce you right away to this world of programming.
Ultimately, the course focus is on a language called C. It's C,
and then C++, and nowadays, C#, that a lot of the programs on your own
computers, particularly Windows computers, are written.
And it's in C that the course's focus ultimately is.
In the beginning, though, we're going to introduce you
to the idea of programming.
And the concepts underlying programming, without the distraction of what you'll
quickly come to appreciate or abhor, as parentheses and semicolon,
and what on first glance, is otherwise fairly arcane syntax.
And what we'll introduce instead, in just the first week of the course,
is a programming environment, a graphical programming environment,
known as Scratch.
Scratch essentially will allow you to program, quote unquote,
merely by dragging puzzle pieces of sorts,
that are color coded and shaped according to the type of logic
that they implement.
This is perhaps best explained for today's purposes
by way of a little demonstration.
What I've brought along with us today is, for instance, one Scratch project
that a former student of mine implemented.
And this is your 5 second overview of what the interface looks
like on Wednesday and Friday when we dive into programming
in the context of this thing.
But I'm going to go ahead and play what, for this student,
was the outgrowth of just one week of class, the semester she
took this class, a two day introduction to Scratch.
And this is what she submitted for her homework.
It's in the spirit of an animation, or a fairy tale.
And that there is her first bug.
[LAUGHTER]
[SCREAMS]
[LAUGHTER]
All right, so what was most gratifying for us,
the teachers, that semester was this student
really had not programmed before.
And again, after just a few hours of time
with us introducing Scratch, and introducing some basic programming
constructs like loops, and conditions, and statements,
and Boolean expressions, was she able to come back just a few days later
and present this to her class.
The nice thing about Scratch then is that, certainly,
for those among you who have never programmed before,
and are just a little bit daunted by the idea of this course at all,
is that in just a week's time, you, too, will be
submitting something along these lines.
Subject entirely to your own creativity, we make no requirements really
as to what the thing must do, look like, or sound like.
But you'll have this experience, we hope,
very early on of actually producing an interactive,
or a dynamic, computer program.
And the fact of the matter is with more traditional languages like, Java, C,
C++, you just can't get to GUEs, graphical user environments,
or really sexy software, in just one semester because there's so many steps
that you must take before getting to a point of sophistication where you can
implement that stuff in these more traditional languages.
For this next demonstration of Scratch, and this teaser
of where we're going next week, I do need a volunteer from the crowd.
The catch is-- it's a non-speaking role, so you don't
need to feel that kind of pressure.
The catch is you will appear here on film.
And so to satisfy the lawyers and such, we need you to sign your name away,
just saying that you realize that you were filmed today,
and you're OK being on the internet.
[LAUGHTER]
I don't know-- Thomas is not volunteering.
So we do need one volunteer.
If ever there were way to prove to your parents that you go to class,
come on down.
[LAUGHTER]
Come on.
So this program here simply requires that-- this was a student--
Carlos was his name-- who implemented essentially
a soccer program, whose functionality will largely speak for itself.
The only instructions you need to know are that as soon as I click go,
you're going to simply want to click with the mouse on the player himself.
And he will run and kick the ball.
So here we go.
I'm starting the program.
So go ahead and just click the player with the mouse button
when you want him to kick the ball.
And the goal is, of course, to hit the target.
VOLUNTEER: Oh, so it's like a timing thing?
DAVID MALAN: Exactly.
[WHISTLE BLOWS]
[LAUGHTER]
[WHISTLE BLOWS]
VOLUNTEER: Oh!
[LAUGHTER]
DAVID MALAN: Keep going.
This is harder than it looks.
[WHISTLE BLOWS]
AUDIENCE: Oh!
[WHISTLE BLOWS]
Oh!
DAVID MALAN: Yeah, one more.
[WHISTLE BLOWS]
OK, a round of applause, if we could.
[CLAPPING]
You know, I heard those comments, and yeah, it's a non-speaking role,
but you try hitting a moving target with 200 people watching you.
It's probably not the easiest thing.
This last demonstration that I wanted to give you
also is a teaser as to where we're going in just one week's time,
starting this coming Wednesday.
Was actually submitted by one of the teaching fellows.
We sort of, as a "get to know each other" exercise this past week,
all produced our own Scratch program, so that we, too,
would experience the same experience that you're
about to have over the coming week.
This was a favorite of mine, but I love them all, of course.
[LAUGHTER]
And this one is not interactive, but also
speaks to the dynamism and the capabilities
of this particular environment that you, yourselves, will
be unleashed on coming this Wednesday.
[MUSIC PLAYING]
[MUSIC - THE WEATHER GIRLS, "IT'S RAINING MEN"]
DAVID MALAN: So we'll make that available for download on the website.
[LAUGHTER]
[CLAPPING]
All right, so that's just week 0.
What are we doing the next week?
So it's in week 1 of this course-- computer scientists, of course,
count starting at zero-- is the good joke there--
we'll introduce C. So come next Monday, will you
be introduced to this more traditional language of C, which
certainly, on first glance, is, in fact, more arcane say, than the puzzle pieces
you've just glimpsed a moment ago.
But it's literally in the second week of this course that we'll
dive in to programming in a more traditional sense,
with a lot of those constructs, if you will, out of the way in a fun
and engaging environment.
In week 2 of the course, we'll continue our exploration of C,
and the functionality thereof, how to program at a more sophisticated level.
But we'll do this, as will be the case throughout the semester,
in an interesting domain.
We'll look at cryptography, the art of concealing data,
among other topics in that same context.
In week 3, we'll look at some of the more canonical program
problems in computer science.
Among them, searching, a la Google, and sorting with which you can actually
expedite things like searches, figuring out-- not out of, say, 12 or 16 doors--
but out of a billion doors, behind which is a number
that you actually want to find.
In week 4, we'll talk about what it means to debug software,
and what it means to design software well.
We'll come back to that particular picture, but that
is quite literally a picture of a bug--
dare say, the first bug.
In week 5 of the course will look similarly
in more technical detail at what it means to run a program.
When you double click that icon on your desktop,
what exactly is going on inside of the computer?
What is going on with the so-called memory and RAM?
We'll also look at a rather sexy context for this exploration
of digital forensics, recovering data, undeleting files, and introducing you
to those kinds of ideas, as well.
In week 6 of the course will we begin to look at what
are typically called data structures.
There are entire courses on data structures at Harvard.
What we'll do is scratch the surface at some of the most useful
of them, with some of the most common of them, most canonical of them.
Among them tries, and hash tables, and heaps,
binary search trees, and linked list.
It's OK if none of these topics make sense to you
now, if you've never heard of them, that's precisely the point of being
here in the first place.
In week 7, we'll look at data compression.
How do you take a very big file, a very big essay, for instance,
and compress it down into something much smaller?
We'll look, therefore, at Huffman coding.
We'll back to this idea of bits.
How can you actually start writing individual zeros and ones
to files on disks in the interests of using as few bits as possible?
In week 8, we'll take a look underneath the hood,
so to speak, at what's going on when you actually run a program,
not in terms of memory, but in terms of its CPU.
We'll look at an assembly language that is
known as Ants, which is about as low level as you can get to a computer's
actual CPU before the language itself becomes just zeros and ones.
In week 9, we'll look at a topic known as secure coding.
Ask me in about 10 weeks time-- or better
yet, tell me in 10 weeks time-- why there's
a picture of a canary on this slide.
And in week 10, what we introduce one of the topics that's new to the course
this semester, which is an introduction to web based programming and PHP.
So in addition to Scratch and Ants and C,
we'll also introduce a popular language called PHP this semester.
Those of you who have log into Facebook obsessively--
and perhaps are logged into Facebook right now--
might recognize--
[LAUGHTER]
--might recognize that early on-- and I believe,
to this day-- was the language in which Mark Zuckerberg wrote Facebook.
SQL is the language in which the database
queries of Facebook and innumerable other websites
use to actually get at databases worth of information.
So by week 10 in this course, will you know not just how to make a web page,
since we'll spend perhaps 20 minutes on that particular process, but actually
how to create dynamic, interactive database driven websites.
In week 11 of the course, we will figure out
what to do based on the kinds of questions and interests
that arise over the course of this semester.
And in week 12, we have a fun and exciting conclusion, if you will.
But it's really in the course's problem sets
that you'll get your hands the dirtiest with this material.
And it's in the problem sets completion that you'll gain, I think,
the most from this course.
To give you a sense of what kinds of topics and domains
will be looking at this semester-- the first one,
problem set 0, will quite simply be, go make your own Scratch project.
We'll lay out just a few basic requirements, but for the most part,
you are free to design anything that comes to mind,
and anything within the boundaries of your own imagination.
In problems set 1, in a couple of weeks time,
will we introduce C and a bit of Linux to you.
In problem set 2, we'll look at cryptography.
And you'll actually implement programs that both incipher and decipher data
that you might want to keep secure.
Problem set 3 will implement the game of 15, which is a name I didn't even
know what it applied to.
This is that silly, little plastic game with all the numbers,
and you can move the numbers up and down and left and right.
And there's 15 numbers, and one of the squares is empty.
And you try to move those numbers around.
Apparently, it's called the game of 15.
And that's what we've been doing the course has
been doing for the past few years.
You, yourselves, will implement that in the language known as C.
In problem set 4, we'll look at this sexy art of digital forensics.
Odds are, we will hand to one of the teaching fellows
a digital camera and a memory card, have them go take some photos around campus.
They'll then turn the camera back over to me.
I will accidentally erase the camera's memory card, turn it over to you
all, and you're going to recover those photos for us.
And you'll also search through some data sets for hidden information of sorts.
Problem set 5, you will be challenged with implementing a faster spell
checker than your classmates.
And we'll turn this into a bit of a contest, whereby to test your code,
we'll give you some software that essentially runs your spell
checker against some fairly large predetermined inputs,
and then will post to the course's website automatically, say, the top 10
or top 20 students' results, so that we can see exactly who is outputting
the most efficient code at that point.
In problem set 6, we'll implement what's called
"huff and puff," the Huffman coding algorithm, with which you, yourselves,
will implement software with which to compress and decompress
files on your own computers.
And finally, in problem set 7 will you actually
implement your own dynamic database driven website.
It, though, is the final project that we dare
say is ultimately the most gratifying aspect of this course.
The problem sets come to a conclusion a week or so before winter break,
and the final project is not due for a month or so thereafter.
And it's out of the final project that some of the most amazing and most
interesting projects come from this course,
not only from students who came in with a background in AP Computer Science,
but those who have quite literally never programmed before.
Here, too, it will be completely up to you what kind of program--
software programs you produce as part of your final project.
But the gauntlet we throw down before you today ultimately--
and we'll remind you of throughout the course of the semester--
is ideally, to solve an actual problem, to make something useful,
or best yet, somehow impact campus.
For the next four months, as you walk around campus,
and have conversations with folks in your extracurricular activities,
in your dorm rooms and such, identify problems that might exist on campus,
or opportunities for software based solutions.
Just a few years ago, there was not a very good Facebook
on Harvard College's campus.
And a student, who you've all heard of, went
about solving that problem himself, having just had a background
in just a few courses in programming.
The Just a few years ago-- and I'm trying
to spin this without it being attached to my name-- just a few years ago,
there was no way for students to look up shuttle schedules dynamically
on computers, or via text message, or via AOL Instant messaging.
So some student who awhile back had taken CS50,
went about implementing software that solved that particular problem.
So the spin that we'd like to give to the final project this year--
and you have four months to figure out what problem you're going to solve,
and what contribution you're going to make to this campus--
and not to set the bar too high.
You can also just make a simple game or a program that's
perhaps less ambitious than that.
But we want to [INAUDIBLE] you early on in the semester is to keep an eye out
for opportunities, processes that you can automate,
programs you can write for your student groups,
and ultimately, give a little something back based only
on your own experience in this course.
Ultimately, it would be a wonderful thing if your software-- not only say,
garners the attention, I dare say, of say
The Crimson, a few of you-- but to make something that outlives this course.
So should you take computer science 50?
I will stick around, as will some of the teaching fellows,
for the next short while.
But today, tomorrow, and Thursday, in this same room from 4:00 to 5:00
PM, we'll be here to answer questions, address concerns.
Otherwise, I will see you on Wednesday.