ProgrammingMethodology-Lecture04.pdf
(
61 KB
)
Pobierz
Programming Methodology-Lecture04
Instructor (Mehran Sahami)
:So welcome back. Now we’re officially started with the
class. I hope you had a good weekend. I was just asking people before class what kind of
stuff they did this weekend. So if anyone wants to, come early. We’ll just engage in
random conversation.
So a couple of quick announcements: There’s one handout, which is your section handout
for this week. Make sure you get that. What I’ll do every week that we have a section, is
that week, you’ll get a handout on Monday, which is a problem that you’re going to go
over in section.
This gives you a chance to think about it before section. It’s not required that you do it.
It’s not extra homework; it’s just something and if you want to read through it to get
familiar with what you want to do with section or possibly do it yourself if you want
more practice to be prepared for section, you can do that and then you’ll go to section;
you’ll cover the problem and actually in section, you’ll get solutions to the problem, as
well, so you’ll get examples of code for all the section problems.
Section assignments – hopefully you should have signed up. The deadline for signing up
was Sunday at 5:00 p.m. Section assignments will be mailed out to you tomorrow night
so you’ll know which section you’ve been assigned to and you can go to sections this
week, get your section leader’s email address, complete Assignment 1, at least the email
part by sending email, and I don’t need to mention the sections actually start this week, so
you should go this week once you get your section assignment.
If for whatever reason you didn’t manage to sign up for a section, you should remedy the
problem by emailing cs198@cs and let them know you forgot sign-up for a section for
CS106a and they’ll let you know what times are available and you can sign up.
Don’t email me because I have nothing to do with the sections, other than actually
assigning the problems for the section. Don’t email Ben because he’s not involved in
administration for the sections either. He also worries about the content of the sections.
But the 198 folks handle all the administration. Uh-huh?
Student:
[Inaudible]
Instructor (Mehran Sahami)
:Yeah, you should submit it again after you’ve been
assigned to a section just to clarify. All right, but if you’ve already submitted it, we can
sort figure it out eventually, but it’s in your best interest to re-submit it after you’ve been
assigned to a section. So any questions about anything else before we start? Uh-huh.
Student:
[Inaudible].
Instructor (Mehran Sahami)
:Yeah, the most submission is the one that’s counted if you
submit multiple times. It just lets you kind of submit more if you’d like, if you submit
something and you’re like, “Oh, I made a mistake.” Then you can go back and submit
again. We don’t feel like, “Oh, every time I like save, I need to submit.” Don’t worry;
just submit when you feel like you’re done and if you need to go back and make changes,
that’s fine. Uh-huh?
Student:
[Inaudible].
Instructor (Mehran Sahami)
:If it’s really necessary and the main thing is if there’s
space in other sections. Yeah, you would email cs198@cs and let them know. All righty.
So let’s go ahead and get started with the actual content. And so today is the day where
we make a little bit of a transition. It’s like one of our transition points in life. It’s kind of
like coming to college. And the transition point we make is you now come into the Java
world, and you’re like, “But I'm still doing Karel.” Yeah, in lectures, we’re going to start
to wave bye bye to Karel and Karel’s like, “Yeah, I’ll be there in your dreams when
you’re actually programming, right.”
So Karel’s not really gone until you’re done with the Assignment No. 1. But now, we
take – we sort of graduate into the world of Java and you’ll actually see that a lot of
things that exists in Karel’s world will come back because we give them to in a gentle
form in Karel’s world and then the Java world, they come full steam.
So before we dive into that, I want you to get a little notion of the history of computing.
Okay, and we’ll go over this very briefly, but computing actually has a very long history
and it dates back about 4,000 years, okay. So roughly 4,000 years ago, the first one we
think of is computing device was made available, but then you want to know what that
was? Advocates.
The first computing device allowed you to do some fairly rudimentary arithmetic on it,
but it actually was something that allowed people to compute a lot faster than they could
by keeping track of stuff in their head. The real sort of advances in what we think of as
computing actually came around in the 1800’s. That was someone by the name Charles
Babbage. Anyone heard of Charles Babbage, by the way, a just quick show of hands. We
can just call him Chuck.
He was actually a very well learned and well-known person in his day. He had the
Lucasian chair, which is the same chair at university that actually Steven Hawking has
now that Sir Isaac Newton had at one point. So, pretty smart dude, and he came up with
this notion of something called the Difference Engine, which is a way of being able to
automatically.
And in those days, right, they didn’t have silicon. Well, they had silicon, but it was in the
form of sand, and they didn’t have computers in the way we think of computers, so he
wanted to build a mechanical device like with real, actual, you know, mechanics and
pieces of woods that’s been around, and in his time, he thought is would be powered by
steam, right, because this is sort of pre thinking about electronic computers that would do
automated calculation.
And he designed something called the Difference Engine and then he designed something
called the Analytic Engine, which was supposed to be even more powerful, and
interestingly enough neither one of them was actually built during his lifetime.
It turns out that years later, the difference engine was actually built from a bunch of
wheels and rotors and stuff and now the things, you know, that he would have liked to
think of as the Analytic Engine is actually these puppies. It actually turned in the 1800’s;
he had a lot of the same ideas that are in our laptops or in our computers today strangely
enough.
But, so that’s kind of where our computing we think of the notion of computing is really
coming from, and it turns out the first programmer was a woman by the name of Ada
Byron, actually Augusta Ada Byron and if the Byron looks familiar, too, is because she
was the daughter of Lord Byron, the English poet and she was actually very taken by the
designs of Charles Babbage’s machines and actually wrote programs.
The machines were actually written to have sort of cards, sort of like the Jacard Loom if
you’ve ever heard of the Jacard Loom, if you haven’t, it’s not important, that actually
would have programs for the kind of computations that it would do and see, she actually
devised various programs for Charles Babbage’s Analytical Engine.
And you might be sitting there and you might think, “But Marion, you’ve just told me
that the Analytical Engine was never actually built in their lifetime, so what’s she doing
writing programs for a computer that doesn’t exist,” and that’s actually something that
happens today. People write programs for computers that don’t exist and you might
wonder why. That’s not a very good use of your time.
Well, guess what, if the next generation of computers is going to come out while it’s still
being designed before it’s actually manufactured and built, someone needs to figure out
what kind of programs you want to run on that machine, so there are actually
programmers today who actually write programs for machines that aren’t built. And they
simulate them by hand and they go through and try to figure out what they would do and
it’s perfectly reasonably thing to do.
But as a result, Ada Byron is in some sense, the first programmer, right, because she was
actually writing programs for in some sense, a general purpose computational device over
100 years ago, which is kind of an astounding thing if you think about it.
Now it turns out computing actually got its first real, you know, what we think more
closely of as computing devices in the 1930’s. I should put 19 here just so we’re clear –
1930’s and 40’s, they were sort of the first prototypes of electro mechanical computers
that were actually built at the time.
There was a computer that was built at Iowa State by Atanasoff and Berry. Their names
are actually not – well, they’re important if you’re a lawyer because it turned out there
were actually lawsuits at the time by who patented it in the computer, but we won’t talk
about that.
Started sort of in this era with sort of prototypes and then the one machine you may have
actually heard of by 1946, there was a machine called ENIAC, which was actually built
by Elkhart and McCauley at U Penn which was standard for, if I can remember this, for
electronic, numerical integrator and calculator.
And basically with one of these big things, you know, sat in a big warehouse, a few tons,
but it actually did computational, you know, the kinds of things we would think of as
computation and it was really in some sense the first large-scale electro magnetic
computer that we think about, again, you know, modular lawyers.
And then really it was in 1971, that the first microprocessor came around, so we come to
a fairly modern time, right, so it’s not all that long ago, like we’re talking 36 years, the
microprocessors have actually been around.
And so the first microprocessor and one of the folks who was on that team who built the
first microprocessor, Ted Hawk, is actually Stanford alum, interestingly enough, it was
built at Intel. The Intel 4004 was the name of that microprocessor and at the time, no one
actually thought that having a single chip microprocessor was going to be that interesting.
He sort of designed this thing and it was originally going to be going over for use in some
machine in Japan and they were just going to give them some design and the patent for it
and the folks were getting like, “Well, we’re not really interested. Yeah, sure it’s an
interesting chip, but we’re not really interested in, you know, owning the patent. We
don’t think there’s anything interesting necessarily here,” and so they kind of ran with it
and the rest is history, as they say.
And as you can imagine in the last 35 years or so, there’s just been an astounding amount
of development in computing and computer science, right, so really this field is like
hundreds or thousands years old, if you think about it, but really it’s kind of in your
lifetime that all the interesting stuff is really happening, which is also why it’s exciting to
be alive now and be a computer scientist because you’re in this acceleration phase, right.
Think about what’s going to happen, like all the stuff that happened in the last 36 years,
you’re gonna be around to see the next 36 years and you’re gonna be doing the next 36
years, so that’s just an exciting thing that I think about.
But another thing that comes up when you think about this, what is computer science,
right, like why do we – we’ve been talking about Karel programming and a lot of this
class we’re gonna learn about software development and Java programming and so a lot
of people tend to equate computer science with programming and they think, “Well, why
isn’t a major just called, you know, computer programming and why is there really a
science to it in some sense.”
That’s something that people actually would use to debate. They don’t really debate it so
much anymore. Is there a real science to computing or is it just programming and in fact,
the difference between the two is that computer science or CS as we’ll just affectionately
refer to it, really is the science or in some sense, the study of problem solving with
computers, and you don’t need to write his all down; it’s just for your edification, with
computers or I should say, computational devices.
Computational – I’ll even say methods because some people actually look at, you know,
theoretically what’s possible without even necessarily thinking that it’s real life in
hardware, right.
Turns out it actually surprises people there are some functions that you can prove are not
computable. I'm like, “Really, you can?” Yeah, and it’s good to know about them before
you go and try to write a program to actually compute them because in theory they’re not
computable and you can prove that, and if you’re actually interested in that, take CS 103
or CS 154 and we’ll talk about it all the time.
But that’s really what the science is, is thinking about problem-solving and the
approaches to problem-solving, how you analyze how efficient a solution is to a problem,
how solvable it actually is, the different approaches you take to it.
So, notice the word programming doesn’t show up here. Programming is an artifact. It’s
something we do to realize that particular problem-solving technique in a computer or
some computational method. It’s just something we do as part of the process, right. It’s
not what the whole thing is really about.
In some sense, there is actually this famous quote that computer science is just as much
about programming as astronomy is about building telescopes. Right, astronomy is about
far more than building telescopes. It’s really sort of a science of celestial bodies.
Telescopes is the mechanism by which you actually look at them. Uh-huh, question in the
back?
Student:
[Inaudible].
Instructor (Mehran Sahami)
:Well, if you think about computer engineering, part of it is
just kind of a definition that a particular school wants to have for it, right. And some
places actually – our computer science program is in the School of Engineering. Some
places it’s actually in humanities and sciences. It depends on the view and it also depends
on the particular program that’s there, so some places may actually –there’s no way I'm
gonna hit you in the back – may just be training programmers, right.
And the science of computing is not what they’re actually interested in, and so it depends
on the program, but we really think of the computer science as a science, and it’s an
Plik z chomika:
m_r_k
Inne pliki z tego folderu:
ProgrammingMethodology-Lecture01.html
(61 KB)
ProgrammingMethodology-Lecture01.pdf
(63 KB)
ProgrammingMethodology-Lecture11.html
(61 KB)
ProgrammingMethodology-Lecture04.pdf
(61 KB)
ProgrammingMethodology-Lecture03.pdf
(66 KB)
Inne foldery tego chomika:
Zgłoś jeśli
naruszono regulamin