ProgrammingMethodology-Lecture01.pdf

(63 KB) Pobierz
Programming Methodology-Lecture01
Instructor (Mehran Sahami) :Alrighty. If you could have a seat, please, we need to get
started. There are still a bunch of people coming in the back. Come on down and try to
find a seat somewhere. If you can't find a seat, sit in the aisle as long as you're not a fire
marshal. Anyone here a fire marshal? Good. We're fine. Come on in and sit in the aisles.
So welcome to CS106A. If you don't think you should be in CS106A, you think you
should be somewhere different, now is probably a good time to go, not that I would
discourage anyone from taking this class. I think we'll have a lovely time in here. But this
class is CS106A or E70A, so if you're, like, "Wait. I thought I was in E70A," you're fine.
They're the same class; it's the same thing. No worries, okay?
There's four handouts. They're in the back. If you haven't already gotten the handouts
because you came in and you sat down, don't worry. You can pick them up on the way
out. They're the same handouts. They'll still be there.
So just a quick introduction. That's what the first four handouts actually give you. They
give you a little bit of an introduction to the class, what we're gonna cover, some logistics
for the class and some other stuff. I'm gonna go over all that today so we can sort of get a
good idea for where we're at, okay?
So just a quick show of hands before we get into a bunch of things in the class. This is
kind of an intro-programming course; well, it is. I shouldn't say it's kind of an intro-
programming course. It is an intro-programming course. And it's always good to get an
idea as to how much familiarity you may have beforehand, okay? So just quick show of
hands. How many people can recognize a computer that's on? Good, good. That's the
prerequisite for this class.
So if you're worried about how much previous experience you've had or your friend who,
like, worked their way through high school by programming for Google or whatever,
don't worry about it because all you need to know in here is basically either how to turn a
computer on or to recognize a computer that's on if you were to walk up to it and it were
already to be on, all right?
So but a little bit more seriously, how many people have actually used a computer for
anything? All right. I would expect most of you.
So now, we begin to bump it up a notch. How many people have used it for word
processing? Okay. Most folks.
How many people have done web browsing? Yeah, I won't ask you what you look at, all
right? It's just I don't wanna know.
How many people have actually created a web page? Okay. Fair number.
How many people have done any kind of programming before? Fair number. All right.
How about how many folks have done actually programmed in Java before? All right. A
few folks.
How about another language, C, C++, BASIC, anyone program in BASIC? Yeah, oh, I
love — that was the first language I learned, and it was kind of like the warm and fuzzy,
and I felt good. There was actually people who argued that if you learn BASIC as your
first language, you're brain damaged, then you're just beyond help. But if that's the case,
we're all in the boat together because I'm probably brain damaged as well. The truth is I
probably am, but that's a whole different story.
All right. So one thing you should know kind of up front is actually this course is gonna
be provided eventually somewhere down the line as part of Stanford School of
Engineering Free Course Initiative, which means not only are we recording this course to
broadcast to a bunch of companies and industry who are watching this course, but we're
eventually gonna provide it free to the world.
So how does that impact your life? And on the average day, it doesn't at all. The only
way it does impact your life is just so you should know, the lawyers told me to tell you
that your voice, should you ask a question, may actually be recorded as part of the video.
As a result, your voice may end up going out to thousands of people or millions of people
in the world. If you have an issue with that, come talk to me. If you don't, everything is
just fine, all right?
Don't worry. We're not gonna put your picture up or anything like that. You might wanna
be on the video, like, "Hey, ma, I'm on TV." We decided that we're just gonna not show
anyone actually on the video, but your voice may actually get recorded, okay?
Now, along those lines, you may also notice there are some microphones in the room. So
when you wanna ask a question, please make sure to use the microphone because that's
not only good for people in here to be able to hear your question, it's also good for all the
folks that this is getting broadcast to because not only are we gonna broadcast to the
world, but there's actually some folks who are sort of watching this live now in various
companies in Silicon Valley.
So it's real important that you actually use the microphone, so just remember that. And
every once in a while, I might get on your case and be, like, "Please use the microphone."
I'm not trying to be argumentative or anything. I just wanna make sure we pick up all the
audio, all right?
So with that said, a little bit of an introduction. That's kind of a way of background. I
didn't give you any sort of introduction. So just to introduce myself, my name's Mehran
Sahami. I'm the professor for the class. Don't call my Professor Sahami, way too formal.
Don't call me Mr. Sahami. That, I think of my dad. And don't call me Mrs. Sahami, or
we're gonna have issues, all right? So just call me Mehran. We'll get along. It's just fine,
all right? It's to keep things a little bit more informal, but that way it's a little bit easier to
discuss stuff as you go along.
There is also a head TA for the class, Ben Newman, who's standing up there. Get to know
Ben. He has all the real power in this class. I'm just kind of the monkey that gets up here
and gives the lectures. But Ben really is the one who's got all the power.
Along with the head TA for the class, we have a large section leading staff. So the section
leaders here, could you stand up if you're here? They're kind of all over the place, some
over here, some over there, and some over there. As you can see, there's a pretty large
number of folks. And this isn't even all of them. We sort of have more — we just can't
stuff them all into the room — who are section leaders for the class, and these folks are
all here to make sure that everyone in this class has as good an experience as possible
when we're sort of going through the class.
And the best way to reach all of us is email. So on Handout No. 1, you get my email and
Ben's email. We'll tell you how to sign up for section. That's how you'll meet your section
leader and get your section leader's email. That will all be coming soon. But email really
is kind of a happy form of communication to get a hold of us, okay?
So with that said, I wanna tell you a little bit about this class and kind of what we're
gonna do in here and what you should expect and make sure that you don't feel scared off
by this class, okay? Because it really is meant to sort of be an interesting time.
But one question that comes up is why is this class called Programming Methodology,
right? Why don't we just call this class, like, Programming with Java? And the real reason
for that is that programming methodology is about good software engineering principles.
It's about something that's much larger than just programming.
So some people, like, they'll go and get a book somewhere and they'll think they learned
how to program by just reading the book. And they're, like, "Oh, I know how to program.
Isn't that great?" And it's, like, yeah, you might know the mechanics of the language, but
the mechanics of the language are nothing compared to understanding the software
engineering principles that go into actually developing a software system.
And that's what you're gonna learn about in this class. You're gonna learn a lot of those
principles. But in order to be able to use those principles and apply them, you also need
to have the language to program in, and that language that we're gonna use in this class is
Java.
So the way I like to think about it and the way I tell a lot of people is writing a good
program or learning how to program is like learning to be a good essay writer. And
you're, like, "Oh, but part of the reason I'm taking this class, Mehran, is that I don't like
writing essays." That's fine. It's okay. Trust me. I didn't like writing essays either.
But the whole point is that when you write an essay, it's not a formulated kind of thing.
You're, like, "Well, what about five-paragraph essays?" Yeah, just block that from your
mind. That was a bad time, right? That was just, like, '70s education at work. It's not a
formulated kind of thing.
There's an art to writing an essay, right? In order to write an essay, you need to know a
language. You need to know English or German or Hindi or whatever language you
wanna use, but then you use that language to write an essay. Just knowing the language
doesn't make you a good essay writer though. Being a good essay writer makes you a
good essay writer.
So that's the same difference in programming and software engineering. Knowing the
language, in order to be a good programmer, like a good essayist, you need to know a
language to write your programs in, whether that be Java or C or C++ or whatever. Here
we're gonna use Java.
But just knowing the language doesn't make you a good software engineer and doesn't
make you understand what the principles are of writing good software, which is what
you're also gonna get in this class in addition to the language, and that's kind of a key
thing to stress.
So if you're sort of worried, if you were kind of looking around and you saw a bunch of
people raising their hands when I asked, "Do you have any previous programming
experience?" and some folks raised their hands, and you got a little worried and you're
like, "Oh, am I gonna be in some sense at a disadvantage because I haven't done any
programming before?" The answer, plain and simple, is no, okay? You're gonna learn
everything you need to learn from the first principle because as a matter of fact, in some
cases you might be in slightly better shape. That's not necessarily to say that that's the
way it will be.
But how many people are Star Wars fans? Just wondering. Anyone? I'm talking about the
old-school, original, like, three movies. Those were so good, and we're not — no George
R. Binks here, all right? So if you remember — and sort of I'm a big Star Wars fan, and
that's just a whole separate point. But in the second movie, Yoda actually said something
which I thought was quite profound, which is he says sometimes you have to unlearn
what you have learned.
And one of the things we actually find is that some people who are self-taught
programmers, some of them are just fine, and some of them are very good. But some of
them have picked up some really bad habits along the way, and it's like being a bad essay
writer. And to go from being a bad essay writer to a good essay writer, in some cases, can
actually be harder than from not being an essay writer to being a good essay writer
because you have to unlearn the bad habits.
So if you're worried about, "Oh, I've had no previous experience," don't worry. You're
okay, blank slate, you're just fine. And now if you're thinking, "Oh, I have some previous
experience. Do I have bad habits?" Don't worry. You'll be fine, too, okay? So it's all
gonna work out.
So the next question that kind of comes up — hopefully that helps put some of your fears
aside. Another one of the things is that we really strive to make everyone successful in
this class, okay? At some other schools, people wanna do computer science or they
wanna do an engineering major or whatever. And you come into the first day of class,
and they say, "Oh, only one third of you are actually gonna make it through this program.
And look to the person to your left and look to the person to your right, and only one of
you will make it through." And you're, like, "Oh, man, that's real nice." It's not like that
here.
As a matter of fact, we want all of you to be extremely successful in this class, which is
why we have a huge course staff, which is why over years and years we've refined how
we do a lot of the teaching in this class to make sure you have the best possible
experience and to make sure that everyone gets through.
And the important thing about that is that you're not competing against anyone except
yourself in this class. It's not like we're gonna have a curve and we're gonna say, "Oh, we
have a certain number of "F"s and a certain number of "D"s and a certain number of
"C"s." All we really have going into it is an expectation that when you get out of here,
there's a set of stuff we want you to know. And if you know that stuff well, you get an
"A." And if everyone knows that stuff well, everyone gets an "A." And I got no problems
with that. Registrar might have a problem with that, but that's okay. You don't need to
worry about that.
So you don't need to think about, oh, is someone else doing better than you or whatever.
And we'll talk about issues of collaboration in just a little bit. All you need to think about
is learning the stuff yourself as well as you possibly can, and you'll be just fine and you'll
get a good grade, okay? So that's really all we ask, which is not a trivial amount, right? It
requires you to really understand the material.
So another question that comes up is are you in the right place, right? This isn't the only
introductory programming class at Stanford. And so I wanna spend a little bit of time
making sure you actually are in the right place by going over some of the different
options.
So right now, as you know, you're in CS106A. And CS106A, we're sort of happy over
here, right? As a matter of fact, we're not only happy, we're happy and we're also a little
bit loopy, right? There is no previous programming experience required, as I mentioned,
right? All you need to know is basically if you can get to a computer and know how to
figure out that it's on, you're in good shape.
But what 106A does is it's a real rigorous class. You learn programming in here, and you
learn it in a way that makes you ready to be an engineer if you so choose to be an
engineer. That's not to say you're all gonna be engineers. I would love for all of you to be
Zgłoś jeśli naruszono regulamin