Introduction to Computer Science I

Download Report

Transcript Introduction to Computer Science I

Technische Universität Darmstadt
Telecooperation/RBG
Introduction to Computer Science I
Topic 0: Introduction
Prof. Dr. Max Mühlhäuser
Dr. Guido Rößling
Copyrighted material; for TUD student use only
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
What Computer Science is Not About
The computer!
Just as biology is not “microscope science” and
writing is not “pen science”
Introduction to Computer Science I: T0
2
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
The subject of ICS 1
Problem
Description
mental Model
Challenge: Formulating a
solution that is both easy to
understand for a human and
executable for a machine
huge
representational
gap
executable
program
machine layer
Introduction to Computer Science I: T0
3
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
The role of ICS-1
– Introduction to Programming • Content constraints
• Sociological constraints
• Time constraints
Introduction to Computer Science I: T0
4
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
The role of ICS-1
Parents: “CNN
talks a lot about Java.
Why do you teach
my child Scheme?”
Student: “I know
everything
and Perl is the best!”
ICS-1 Introduction
to Programming
Other Profs:
“Everybody in my
world needs
pointers. This is what
you should teach
in ICS-1!”
Industry: “Today
we are using
C# v4.538. Why don’t
you teach it to
your students?”
Introduction to Computer Science I: T0
5
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
The role of ICS-1
Students who can program
on a similar level
ICS-1
Students with
mathematical
background
Students who
“program”
Introduction to Computer Science I: T0
Students without
previous knowledge
6
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
In many ICS-1 Courses…
• Classic ICS-1 course:
–
–
–
–
You learn the syntax of a fashionable programming language
You use a commercial development environment
You are shown code examples and asked to imitate them
You discuss a couple of algorithmic ideas
• The meaning of the language remains unclear
– superficial explanations
– explanation in terms of implementation details/ hardware
• How you can design new programs remains unclear
Introduction to Computer Science I: T0
7
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Tinkering vs. Design
• Syntax: Tinkering until it works
• Design: Tinkering until it works
• You know some standard algorithms, but this is no
replacement for a program design methodology
• Your knowledge about the meaning of the
language is a mixture of gut feeling and some
details about low-level implementation details of
the language
Introduction to Computer Science I: T0
8
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Work Environment of a Pilot
Appropriate for the first flying lesson?
Introduction to Computer Science I: T0
9
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Work Environment for Experienced Programmers
Appropriate for the first programs?
Introduction to Computer Science I: T0
10
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Our approach: 4 pillars
1. Development environment for beginners
2. Simple programming language
3. Precise models to understand the meaning
of the language
4. Recipes and methodology how to design programs
Introduction to Computer Science I: T0
11
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Development environment for beginners
Introduction to Computer Science I: T0
12
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Simple programming language
• You will not learn only one - but many different layered
programming languages
– Different levels, structured from the pedagogical point of view
• Subsets of the programming language Scheme
– Features that you don’t know yet are disabled
– No bizarre error messages regarding features you don’t know
• We can always concentrate on the design concepts and
ideas that fit your current standard of knowledge!
Introduction to Computer Science I: T0
13
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Precise Models to understand the
meaning of the language
For every language level, we will teach you a model which
explains the meaning of the various programs
– You can “execute” programs on a piece of paper
– These models are not defined in terms of hardware, but their
purpose is to specify the meaning in the simplest possible way
– You will also hear about models illustrating how a programming
language is implemented on typical hardware
Introduction to Computer Science I: T0
14
Recipes and methodology
“how to design programs”
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
• We will not just present programs and ask you to imitate
• We teach recipes – that is, step-by-step instructions –
how you can design programs
– These recipes are more or less independent of the programming
language
Introduction to Computer Science I: T0
15
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Typical program “design” approach…
That is not how we will do it, though … 
Introduction to Computer Science I: T0
16
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
From Scheme to Java
• In the second half of the semester we will use Java
• The design recipes work step-by-step also for objectoriented Java programs
• Many differences are just notation
• More fundamental differences are very instructive
Introduction to Computer Science I: T0
17
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Why not Java first?
• Complex notation, complex errors
• No IDE (integrated development environment) supports language
levels
• Direct interaction with Scheme interpreter makes it easier to get
started
• Design recipes are drown in syntax
– K.I.S.S. - Keep It Simple Syntactically
• Java/C++/Pascal: 90% syntax, 10% problem solving
• Scheme: 10% syntax, 90% problem solving
• Scheme (or Lisp) is the “mother” of most modern language features
– Language features can be studied in full “purity” in Scheme
– Many “new” features of modern languages can easily be understood
once you know Scheme
• Studies show that our approach produces better OO programmers!
Introduction to Computer Science I: T0
18
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Advantages of an easy language
We want to compute the sum of 2 and 3
DrScheme:
We enter the program (+ 2 3),
DrScheme responds “5”
The steps required in Java/Eclipse
are not “nonsense”, but all have
their meaning.
For a beginner, they can be confusing
and unnecessary.
Java/Eclipse:
We start a new project
We create a new package
We create a new class
We write the following program:
package test;
public class Test {
public static void main(String args[])
{
System.out.println(2+3);
}
}
(You need weeks before you understand
every part of this program)
We compile the program
We run the program
The console shows “5”
Introduction to Computer Science I: T0
19
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
Summary
• Training good programmers does not mean starting them
on “currently fashionable” or professional tools &
languages
• We provide a strong, rigorous foundation in basic concepts
of programming
• Then, and only then, we will expose you to current
fashion!
Introduction to Computer Science I: T0
20
Books
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
• Scheme:
– most important book:
How to Design
Programs (HTDP)
– Structure and Interpretations of
Computer Programs (SICP)
• Java
– Thinking in Java
all books available for free online!
Introduction to Computer Science I: T0
21
Dr. G. Rößling
Prof. Dr. M. Mühlhäuser
RBG / Telekooperation
©
More information
• News, Links, Lecture Notes etc. are all available on
our homepages:
http://proffs.tk.informatik.tu-darmstadt.de/gdi1
http://proffs.tk.informatik.tu-darmstadt.de/gdi1/en
Introduction to Computer Science I: T0
22