< Return to Video

Conclusions (14 mins)

  • 0:00 - 0:07
    Alright, welcome to the last CS1 Lecture
    Session. There's not going to be exercises
  • 0:07 - 0:11
    for this section. I'm just going to try
    in, I don't know, summarize what it all
  • 0:11 - 0:15
    means and talk about some next steps. So,
    for CS101, I took the strategy of just
  • 0:15 - 0:20
    jumping right in with code really and we
    got into the detail of codes and played
  • 0:20 - 0:24
    with the code and my plan was that as you
    played with code and have bugs and
  • 0:24 - 0:29
    experimented that you would gradually just
    come to see what some of the features are
  • 0:29 - 0:33
    of the computer. So, I hope that works.
    Today I'm going to step back and talk a
  • 0:33 - 0:38
    little bit about what it means and
    [inaudible] and things so first thing I
  • 0:38 - 0:44
    want to talk about is this word algorithm.
    I may have used here and there. Algorithm
  • 0:44 - 0:49
    actually it's named after a Baghdad
    astronomer Al-Khwarizmi. Some of his work
  • 0:49 - 0:54
    ends up in the word algebra so he's rather
    influential. So the given algorithm Refers
  • 0:54 - 0:59
    to the steps to take to get something
    done. So, not just saying well I want this
  • 0:59 - 1:03
    script to be you know blue. That's just
    saying what the goal is. The algorithm is
  • 1:03 - 1:07
    really figuring out something to describe
    one step sort of. Now it's not the same as
  • 1:08 - 1:12
    syntax. Syntax is really a computer
    language feature so algorithms I would say
  • 1:12 - 1:16
    capture really human, human creativity of
    how I might going to solve something And
  • 1:16 - 1:20
    really, for CS101, very often for the
    exercises are in lecture examples. I've
  • 1:20 - 1:24
    been describing an algorithm. Oh, take the
    picks and do this and do that, whatever
  • 1:24 - 1:28
    describing the, describe is going to be
    And then I've left it to you to, to then
  • 1:28 - 1:32
    phrase into code and that, that's just a
    totally classic computer system way to
  • 1:32 - 1:35
    work. You have human, you have the idea,
    unless you get phrased in the code. I'll
  • 1:35 - 1:40
    have other bunch of examples sort of. Hit
    that pattern. So this is an example, I
  • 1:40 - 1:46
    won't go to the details exactly but here's
    the code from the Monkey Moon example and
  • 1:46 - 1:51
    so we had the strategy of like computing
    average and then trying and find the blue
  • 1:51 - 1:57
    background behind the monkey and then copy
    the red, green, and blue pixels that is
  • 1:57 - 2:02
    over. So such thin g is that, that's the
    idea which was pretty complicated and you
  • 2:02 - 2:07
    know effective and then here it is
    expressed into code And party, I mean,
  • 2:07 - 2:11
    it's a little bit of amazing that we did
    and my code is fairly complicated, right?
  • 2:11 - 2:15
    So, at least a couple of weeks ago, you
    didn't, you didn't understand this so it
  • 2:15 - 2:21
    also shows the gap where we had this plan,
    what we're going to do but then look at
  • 2:21 - 2:27
    the individual steps in the code. Pixel
    dot got red. You know, average times
  • 2:27 - 2:31
    you're pointing on too. The building
    blocks that the computer has are really
  • 2:31 - 2:36
    pretty simple and I just get that. There's
    no insight, it's just mechanical and then
  • 2:36 - 2:41
    in a way, they get what a computer
    programmer does. I've taken an idea that's
  • 2:41 - 2:46
    interesting and valuable and sort of
    phrase it down to the computer, break it
  • 2:46 - 2:51
    down into the little mechanical steps that
    the computer can do to sort of build up
  • 2:51 - 2:55
    the program that we like one And that's.
    That's a key example. That is what, that's
  • 2:55 - 2:59
    what the modern world looks like in terms
    of the computers, computers doing some
  • 2:59 - 3:03
    usual stuff. So, as long as I was talking
    about code, you know, having an algorithm
  • 3:03 - 3:07
    for phrasing them to code, I also thought
    I could revisit the word bug. I'm sure
  • 3:07 - 3:11
    this is a word you've all heard at one
    time or another. Here's a little example
  • 3:11 - 3:16
    of a bug where I, I have to [inaudible]
    over the image. And then here I've
  • 3:16 - 3:21
    mentioned I'm trying to change the image
    to gray. So, I could help the line of
  • 3:21 - 3:27
    average equal pixels to get red plus get
    green plus get blue/3. The problem here
  • 3:27 - 3:31
    This code does something. It just doesn't
    compute the averages I intended. The
  • 3:31 - 3:35
    problem here is that the slash three only
    applies to get blue. We would need to put
  • 3:35 - 3:40
    [inaudible] in here to make it work right.
    So the results is that was [inaudible] and
  • 3:40 - 3:44
    so the numbers going to come up like 450,
    just way too big and so setting it in to
  • 3:44 - 3:49
    the image makes the image come out almost
    near white. This is just an example of a
  • 3:49 - 3:53
    bug where there was intent, well here's
    the other thing that I might want to do.
  • 3:53 - 3:59
    But the code I typed in Said something
    else. It, it said something but it had
  • 3:59 - 4:03
    steps the computer could follow but it
    wasn't the ones I intended. And that's.
  • 4:03 - 4:08
    That's very often what bugs looks like and
    I'm sure you've have run in the bugs all
  • 4:08 - 4:12
    the time. So there's a little insight of
    how, where the gap was between the intent
  • 4:12 - 4:16
    of the programmer and running out the
    steps for the, the computer actually do so
  • 4:16 - 4:21
    this sort connection I'm talking about is
    at the very start of the class I made this
  • 4:21 - 4:26
    kind of a provocative claim well you know
    computer is to powerful plus two. Computer
  • 4:26 - 4:30
    is so stupid and limited and I stand out
    of that I think because you have seen
  • 4:30 - 4:34
    [inaudible] limitations and yet. That was
    very useful we have e-mail and the
  • 4:34 - 4:39
    Internet and computer games. All of these
    are phenomenally valuable awesome useful
  • 4:39 - 4:43
    stuff so how that works? And I guess
    ultimately the answer is humans, That a
  • 4:43 - 4:47
    human programmer had a creative, an idea
    of like here's what I'm going to do and
  • 4:47 - 4:51
    this is going to be great and that's
    really where, that's what computer
  • 4:51 - 4:56
    programming are, that's what computer
    programmers are and that's where computer
  • 4:56 - 5:00
    science is about and then it gets broken
    under these steps with the computer can
  • 5:00 - 5:06
    actually do it. So I just have some, some
    examples here. Grab some of theses from
  • 5:06 - 5:11
    Stanford so these are examples where you
    have the computer installing these
  • 5:11 - 5:15
    mechanical stuff between something
    [inaudible] it's kind of professional. So
  • 5:15 - 5:20
    Daphne [inaudible] at Stanford has this
    awesome research on grading cancer cells.
  • 5:20 - 5:24
    So basically, you have a [inaudible] dish
    with some sample cells in it. And you show
  • 5:24 - 5:28
    a computer an image of it and then the
    computer is going to eventually, she
  • 5:28 - 5:31
    trains the computer to do great, so
    something that normal humans do that's
  • 5:31 - 5:36
    actually pretty difficult and humans have
    a tough time doing a good job out of it.
  • 5:36 - 5:39
    And so, but when I get that, this looks
    like a little bit like our image code.
  • 5:39 - 5:43
    It's not that you just say that the
    computer, hey, I want you to grade this.
  • 5:43 - 5:47
    Really, you know, the computer just has.
    Values, you know, bunch of numbers and can
  • 5:47 - 5:51
    do less than and gr eater than, you know,
    loops are those building blocks and so the
  • 5:51 - 5:55
    [inaudible] ingenuity to phrase up an
    algorithm for the computer using it's
  • 5:55 - 5:59
    simple [inaudible] to do something
    profoundly useful like [inaudible]. I'll,
  • 5:59 - 6:04
    I'm just putting links here. If you want
    to visit the document then you could try
  • 6:04 - 6:09
    this up. Another example of this just sort
    of amazing is there's a treatment for
  • 6:09 - 6:13
    certain forms of deafness called the
    cochlear implant and this is a little bit
  • 6:13 - 6:18
    of controversy about the deaf community
    about if this is a good idea or not but it
  • 6:18 - 6:22
    is amazing. Other works is there is a
    microphone that takes in sounds and the
  • 6:22 - 6:27
    sound waive is kind of like we saw in the
    analog and digital lectures are processed
  • 6:27 - 6:31
    by a computer and eventually ultimately
    ending up going into wires that go
  • 6:31 - 6:36
    directly in to the, the sense organ in the
    head and so. It's, it's possible to give,
  • 6:36 - 6:40
    not exactly hearing but sort of hearing
    for someone who is potentially completely
  • 6:40 - 6:45
    deaf before. So there's, I gotta say, a
    fairly amazing video Youtube video clip
  • 6:45 - 6:50
    here of the baby hearing their mother's
    voice for the first time. And so it's,
  • 6:50 - 6:55
    it's what's saying, future is about that.
    I gotta say, if I was an engineer who had
  • 6:55 - 6:59
    anything to do with this project, I would
    very proud. Like that is a, it's such a
  • 6:59 - 7:03
    vivid example of the technology really
    changing someone's life Last example.
  • 7:03 - 7:09
    Also, a part from Stanford is this idea of
    self-driving car. So this involves, the
  • 7:09 - 7:12
    car has all sorts of cameras and range
    finders on it and it's sort of, I'll put
  • 7:12 - 7:16
    it in quote. It's Kind of seeing
    surrounding and trying to understand what
  • 7:16 - 7:20
    the obstacles and pedestrians, whatever
    are and then making decision in real time
  • 7:20 - 7:24
    like it has to decide right now what to
    do. That's profoundly a hard problem. But
  • 7:24 - 7:29
    so Sebastian's run at Stanford and now we
    can do this in Google he has made a lot of
  • 7:29 - 7:34
    partners with this and I gotta say, I'm
    sort of a national optimist but I think
  • 7:34 - 7:38
    this is all going to happen. I think it's
    going to happen because although the
  • 7:38 - 7:43
    technological challenges are enormous,
    ultimately it will sa ve time And as
  • 7:43 - 7:48
    society becomes more wealthy, time is just
    something everyone values. I think that's
  • 7:48 - 7:52
    going to provide a lot of pressure to
    make, make this work so I'll be, I'll be
  • 7:52 - 7:58
    interested to deliver long enough to see
    that working. All right So I want to talk
  • 7:58 - 8:04
    a little bit about you know post C101,
    things you might want to think about. So
  • 8:04 - 8:08
    Most people are not going to be computer
    programmers, That's fun we need more but
  • 8:08 - 8:12
    life certainly is not for everyone. So I
    think there is kind of a skill to just
  • 8:12 - 8:16
    working with computers. Computers
    obviously have the sort of mechanical,
  • 8:16 - 8:20
    slightly fragile and I think that just
    have to be just so way that are. And my
  • 8:20 - 8:24
    hope is that, with CS101, you've seen how
    that is at times and in different ways
  • 8:24 - 8:28
    that you, it's [inaudible] you a little
    bit of confidence and a little bit of
  • 8:28 - 8:32
    patience. I think sometimes, people
    [inaudible] something in the computer and
  • 8:32 - 8:36
    I click the button and it doesn't do what
    it's supposed to. And there's, there's
  • 8:36 - 8:40
    sort of stuck of well what I do know. And
    I think they can get past that stuff
  • 8:40 - 8:43
    whereas now, I think you've seen the, the
    kind of the mechanical quality of the
  • 8:43 - 8:47
    computer. My hope is to have a little
    patience. So, okay, well, we're not doing
  • 8:47 - 8:50
    what it's supposed to, let me read the
    docs again, there's probably some little.
  • 8:50 - 8:55
    Dumb thing right I'm missing semi colon or
    whatever. Some little detail that computer
  • 8:55 - 9:00
    is going to get trip by and so I think
    there is a skill to no getting derailed
  • 9:00 - 9:05
    when a computer messes up like that and
    I'd like to thank that CS1 on help. I'll
  • 9:05 - 9:09
    give you what skill a little bit. It's
    certainly a very handy life skill since
  • 9:09 - 9:14
    computers are everywhere. So finally let
    me list of. Classes where thing, things
  • 9:14 - 9:19
    you might want to study after CS101, I
    have bad news about this. There is not a
  • 9:19 - 9:24
    class which I think is really a good fit
    to just be right after CS101 there is just
  • 9:24 - 9:28
    one that I know of so I'm not going to
    recommend the specific one but there's a
  • 9:28 - 9:33
    lot of research and activity in that area.
    Someday day maybe I'll create one but I'm
  • 9:33 - 9:37
    done yeah. So I'm just going to mention
    things that you could look at sort of
  • 9:37 - 9:42
    Poseus point of view. So one thing I'll
    mention is spread sheet. Spreadsheets are
  • 9:42 - 9:46
    very commonly used to organize data or do
    computations or whatever; you probably,
  • 9:46 - 9:50
    probably heard them. So the next time you
    see a problem where someone says oh hey,
  • 9:50 - 9:53
    we could do a spreadsheet for this I'd
    say, you might want you know, you could
  • 9:53 - 9:57
    consider. You might want to take a shot of
    that. The sort of "programming in
  • 9:57 - 10:01
    spreadsheets" is not that different from
    what we've done. Microsoft Excel is a
  • 10:01 - 10:05
    super popular spreadsheet but it's not
    free. The Google Docs spreadsheet is free
  • 10:05 - 10:09
    and actually it uses JavaScript which is
    the language we've been using so. Is just
  • 10:09 - 10:12
    so I guess have a question of, of
    confidence of being open like, be open to
  • 10:12 - 10:16
    reading the docs and reading some examples
    I'm trying to use them specially I think
  • 10:16 - 10:19
    would not be much a lot of them from what
    we've done and they're very common. Very
  • 10:19 - 10:24
    commonly used for, for problems, for
    problems like that. So another next step
  • 10:24 - 10:30
    is to take a sort of your general college
    introduction to [inaudible] course. A lot
  • 10:30 - 10:37
    of colleges just have this and I think
    some high schools to. So Cs101 is not a
  • 10:37 - 10:44
    general programming course. I had the
    analogy somewhere that it's as if there is
  • 10:44 - 10:49
    this island and it has. Hundred miles of
    trails on it which represent all the
  • 10:49 - 10:54
    different types of program you might want
    to do and a way when a time with CS101 is
  • 10:54 - 10:58
    I've, I have very carefully chosen fifteen
    miles of trail. So, I've showed you, you
  • 10:58 - 11:03
    have seen real programming issues. You
    definitely have the sense of what bugs
  • 11:03 - 11:07
    are, what those are and those are
    absolutely vital core programming and of
  • 11:07 - 11:12
    course, you, you have done them
    [inaudible]. However There is the 85 other
  • 11:12 - 11:15
    miles all sorts of stuff. I didn't talk
    about it. I sort of constructed my
  • 11:15 - 11:19
    examples and the way the lectures work to
    just carefully use the things I talked
  • 11:19 - 11:23
    about and not trying to get distracted by
    all of the stuff I didn't talked about. So
  • 11:23 - 11:26
    you just know. That's kind of CS101 leave
    you versus the regular program and c
  • 11:26 - 11:30
    ourse. In a way you've been a nice head
    start. You've seen all these computer
  • 11:30 - 11:34
    stuff. You have seen loops or whatever
    setting. You have got a bit of a tail end.
  • 11:34 - 11:38
    Going to it, general programming course
    You would expect it to move faster than
  • 11:38 - 11:42
    CS101. I was pretty, I tried to keep CS101
    at a pretty measured hay anybody can do
  • 11:42 - 11:46
    this. I don't want to be able to,
    stressful experience. So you, you would
  • 11:46 - 11:50
    expect a bump up in the speed but
    certainly something I'm sure many of you
  • 11:50 - 11:56
    would enjoy doing. So something about I'm
    just going to mention a couple other, a
  • 11:56 - 12:03
    sort of specific type of programming that
    people talked about. So HTML five or first
  • 12:03 - 12:09
    to web page programming that's done with
    HTML, Javascript and CSS. We've done
  • 12:09 - 12:14
    JavaScript in CS101 but I gotta tell you,
    the JavaScript for web pages is going to
  • 12:14 - 12:18
    look more complicated, have more going
    out. We, we do this very stripped down
  • 12:18 - 12:23
    very focused type of JavaScript. So, for
    lot of these kind of topics that I
  • 12:23 - 12:27
    mentioned here. A, the [inaudible] college
    students when we think about it is that
  • 12:27 - 12:32
    you take the General Programming course to
    just sort of get a general loop statement
  • 12:32 - 12:36
    sort of experience to have a sort of
    generic ability and then you make the
  • 12:36 - 12:41
    specialized and learn about web pages or
    something. It happens when programming is
  • 12:41 - 12:45
    not that hard and so it's possible to just
    to skip in the web portal in like just
  • 12:45 - 12:50
    have a HTML five or whatever. Of course
    and just sort of just learn the Javascript
  • 12:50 - 12:54
    in the contents to that. So. Other than
    that, I've gotten questions about sort of
  • 12:54 - 12:59
    various areas and I, I, I find it hard to
    identify anyone in particular I say, yeah,
  • 12:59 - 13:03
    there's phone programming, game
    programming, finance programming and
  • 13:03 - 13:07
    science programming, that, that, that.
    What I can tell you is. It's a huge field.
  • 13:07 - 13:12
    There's at you know, science, air
    dynamics, finance, I mean, any, anything
  • 13:12 - 13:16
    you could mention. There's, there's
    computers going on and generally, it's
  • 13:16 - 13:22
    regard to there's tends to be a shortage
    of people and so if you are interested
  • 13:22 - 13:26
    about computer, you know, if you learn
    about computers and y ou want to work
  • 13:26 - 13:32
    with, anyways, there's a good chance that
    you could. There is demand for people who
  • 13:32 - 13:37
    know that stuff. So I guess I have to sort
    of summarize the, the course here so I
  • 13:37 - 13:42
    might claim at the very start of the class
    was the CS1, CS101 teaches the essential
  • 13:42 - 13:46
    qualities of computers by playing with
    code. You've certainly played with a lot
  • 13:46 - 13:51
    of code at this point so I hope that sort
    of holds up my fear Is that people go
  • 13:51 - 13:56
    through life. They use computers all the
    time but they see the computers are sort
  • 13:56 - 14:00
    of opaque and not comprehensive but
    something they could never understand and
  • 14:00 - 14:04
    I hope I hope I have put that down. That
    you can sort of see through the other side
  • 14:04 - 14:08
    and appreciate oh The computer is working
    this way and then I can know this sort of
  • 14:08 - 14:13
    thing, Whatever so just sort of pretty in
    context of how computers work in your
  • 14:13 - 14:17
    life. So as I said before I also hope
    that, with that knowledge CS101 gives
  • 14:17 - 14:21
    everyone a little bit of confidence and
    maybe a little bit of patients to work
  • 14:21 - 14:25
    with their computers and kind of get them,
    get computers to work for them. They are,
  • 14:25 - 14:30
    as what I've said they are stupid
    mechanical but. They're also incredible
  • 14:30 - 14:31
    useful. Alright, take care.
Title:
Conclusions (14 mins)
Video Language:
English
francescola edited English subtitles for Conclusions (14 mins)
francescola edited English subtitles for Conclusions (14 mins)
francescola edited English subtitles for Conclusions (14 mins)
stanford-bot edited English subtitles for Conclusions (14 mins)
stanford-bot edited English subtitles for Conclusions (14 mins)
stanford-bot added a translation

English subtitles

Revisions