Why Program? CSE111 – Great ideas in Computer Science

advertisement
Why Program?
CSE111 – Great ideas in Computer Science



Clearly programming fits here
Programming is a Great Idea in Computer Science. It
has allowed computers to become what they are
today.
The course satisfies the Math Requirement




Clearly programming has something to do with math. Even
Karel has something to do with math
It uses to logic we studied earlier
Helps us understand how computers make decisions
Can be painful
Copyright © 2008 by Helene G. Kershner
Why Program?

Why does anyone program?





Good job
Recreation
Tool for problem solving
A new way of thinking
Understand what’s going on inside the
machine
Copyright © 2008 by Helene G. Kershner
Why Program?

Recreation? HUH?



Another kind of artist
There is a creative joy for some in writing a
program
Amateur programming for some is not
different than amateur photography for others
Copyright © 2008 by Helene G. Kershner
Why Program?

Teaches clear communication




What is the problem?
What do I KNOW about the problem?
What am I trying to solve?
Break the problem down into parts that are
solvable – maybe

Break it down into parts that can at least be
explored
Copyright © 2008 by Helene G. Kershner
Why Program?



Change the way we think!
Think differently, think clearly, think with a sense of
precision
Natural Language is not the best tool for thinking.
Why?





What we “mean” and what we “say” are often not the same
It is inherently imprecise
It involves idioms
Words say one thing and mean another
How we say things matters




Facial expressions
Body language
What we don’t say is often more important than what we do
Lawyers are the artists of Natural Language
Copyright © 2008 by Helene G. Kershner
Why Program?

Programming requires a language that is
very precise (often to the point of
frustration).



Logical thinking is straightforward in a
programming language. It is not
straightforward in a natural language
Programming can force us to think clearly
If we think it but can’t say it clearly do we
really understand it?
Copyright © 2008 by Helene G. Kershner
Why Program?
Problem Solving:
 Ever been in an argument where you can’t
seem to make yourself understood?
 Perhaps that is because we don’t really
understand the point we want/need to
make.
 Question: If we think we understand
something but can’t say it clearly do we
really understand it?
Copyright © 2008 by Helene G. Kershner
Why Program?



Programming is a structured form of
problem solving
It is a mechanism for practicing and
organizing how to think
For some of us it is natural, for others it is
not, but the structure is helpful
Copyright © 2008 by Helene G. Kershner
Why Program?

Most problem solving is a “head” thing!
The problem is running around in my head and
possible solutions seem to be chasing it
round-and-round.
Copyright © 2008 by Helene G. Kershner
Why Program?

Programming teaches problem solving without a
total all-consuming awareness of the
mathematical tools that are at it’s core.




We use algebra
We use logic
We use decision making
But we use them in an environment different
from the math we’ve been taught in school
Copyright © 2008 by Helene G. Kershner
Why Program?
Programming presents a style that
empowers us to apply SIMPLE
language and PLANNING to problem
solving.
Copyright © 2008 by Helene G. Kershner
Why Program?
Programming is a thinking skill.

Analyze a problem statement




Think clearly about what the solution could be
Gather information and express clearly the current
state of the problem?



What is the problem anyway?
Express the problem clearly and concisely in exactly words.
Why isn’t it solved yet?
What would it take to solve it?
Begin to address how to go from where we are now
to where we want to be.
Copyright © 2008 by Helene G. Kershner
Why Program?
Programming is a thinking skill.

Analyze a problem statement


Think clearly about what the solution could be


Define the Output
Gather information and express clearly the current
state of the problem?


Define the Problem
Define the Input
Begin to address how to go from where we are now
to where we want to be.

Create an Initial Algorithm
Copyright © 2008 by Helene G. Kershner
Why Program?

Think again about how to solve the
problem!


Revise the Algorithm
Pay attention to details. The devil is in the
details

Make no assumptions
Copyright © 2008 by Helene G. Kershner
Why Program?
What did we do when we learned to program.





Primitives – a basic language
Learned to expand these into blocks that made our
thinking easier – it changed nothing for Karel’s
behavior
Learned to let the machine make some basic
decisions
Learned to let the machine repeat things
Learned to let the machine combine simple decision
making with repeating
Copyright © 2008 by Helene G. Kershner
Why Program?
Problem solving is a tool for everyone,
whether a doctor, lawyer, chef, journalist,
artist, educator or a scientist or engineer.
Everyone, everywhere solves problems
every day. The mental exercise of learning
to organize one’s thoughts so we can
“talk” to the computer, “talk” to Karel,
makes us better problem solvers.
Copyright © 2008 by Helene G. Kershner
Download