ten golden rules for teaching computer...

40
TEN GOLDEN RULES FOR TEACHING COMPUTER SCIENCE Andrew S. Tanenbaum Dept. of Computer Science Vrije Universiteit Amsterdam, The Netherlands http://www.cs.vu.nl/~ast/ 0

Upload: others

Post on 05-Mar-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

TEN GOLDEN RULES FOR TEACHINGCOMPUTER SCIENCE

Andrew S. Tanenbaum

Dept. of Computer Science

Vrije Universiteit

Amsterdam, The Netherlands

http://www.cs.vu.nl/~ast/

0

Page 2: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #1:

THINK LONG TERM

1

Page 3: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

CURRENT STUDENTS MAY WORK UNTIL 2040

2000 2020 2040

1a

Page 4: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

COMPARISON OF TWO ELDERLY OS BOOKS

Per Brinch Hansen 1. Overview of Oper. Sys. 2. Sequential Processes 3. Concurrent Processes 4. Process Management 5. Store Management 6. Scheduling Algorithms 7. Resource Protection 8. A Case Study: RC4000

William S. Davis 1-4. Introductory Material 5. Single Program Systems 6. Multiprogramming 7. Job Control on the 360 8. The JOB and EXEC cards 9. The DD card 10. Function of an Op. Sys. 11. Principles of the 360 12. IBM 360 Disk Oper. Sys. 13. System 360 MFT ...

1b

Page 5: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

COMPARISON OF 2 OLDER ARCHITECTURE BOOKS

John P. Hayes 1. The evolution of computers 2. Design Methodology (register level) 3. Processor Design (instructions, arithmetic) 4. Control Design (sequencing, microcode) 5. Memory Organization (virtual memory, caching) 6. System Organization (I/O, communication)

Ivan Flores 1. Introduction 2. The Channel Controller 3. Interrupts 4. System 360 Interrupts 5. The PDP-8 6. SDS-92, SCC 650 7. IBM 1401 8. Honeywell 200 9. System 360 10. Spectra 70 11. Univac 9000

1c

Page 6: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

THE YEAR 2000 PROBLEM

• In the 1970s and 1980s, COBOL programmers used

two decimal digits to represent the year

• Get it right this time, or the mess in 9999 will be

unbelievable (8000 years of old COBOL to fix)1d

Page 7: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #2:

EMPHASIZE PRINCIPLES, NOT FACTS

2

Page 8: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

SOME EXAMPLE PRINCIPLES

• Iteration vs. recursion

• Compilation vs. interpretation

• Caching

• Use of hints

• Hashing

• Locality in space and time

• Delayed binding

BUT: Illustrate each principle with at least two examples

2a

Page 9: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

PRINCIPLES FOR A FEW SELECTED COURSES

Course Some principles

Architecture Data paths, memory hierarchies, buses

Compilers Grammars, parsing, code generation

Networks Layering, protocols, routing

Operating systems IPC, memory management, file system

Programming langs Paradigms, data types, syntax, semantics

2b

Page 10: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #3

EXPECT PARADIGM SHIFTS

1965 1995

3

Page 11: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

EXAMPLES OF PARADIGM SHIFTS

• Assembly language to high-level languages

• Batch systems to timesharing to personal computers

• Spaghetti programming to structured programming

• Imperative programming to object-based programming

• Text-based interfaces to icon-based interfaces

• Isolated machines to LANs

• Local computing to the Internet

• Computers for computing vs. communication

3a

Page 12: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

HOW DO YOU DEAL WITH CONSTANT CHANGE?

Teach the students to

• Be critical

• Learn on their own

• Constantly examine their own assumptions

3b

Page 13: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #4:

EXPLAIN HOW THINGS WORK INSIDE

4

Page 14: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

EXAMPLE: THE WORLD WIDE WEB

To many students, operation of the web is a mystery.

Try typing:

telnet www.cs.univ.edu

GET filename HTTP/1.0

to establish a TCP connection to the server. Then type:

Presto! A web page appears as an HTML file. No more mystery. 4a4a

Page 15: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

SIMULATORS GIVE STUDENTS INSIGHT

Examples where simulators can be useful

• CPU cache behavior as a function of size and strategy

• Performance of network protocols when packets get lost

• Paging algorithms in a virtual memory system

4b

Page 16: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #5:

SHOW STUDENTS HOW TO MASTER COMPLEXITY

5

Page 17: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

PREVENT IT IN THE FIRST PLACEPREVENT IT IN THE FIRST PLACE

KISS: KEEP IT SIMPLE, STUPID

5a

Page 18: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

TOOLS FOR MASTERING COMPLEXITY

• Abstraction

• Information hiding (ADTs, modules, objects)

• Hierarchies and layering

• Separation of data from their description

5b

Page 19: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

INTERFACE DESIGN IS THE KEY ELEMENT

• Interfaces are contracts between implementers and users

• They should be designed very carefully to be stable in time

• Interfaces should be minimal but complete

5c

Page 20: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

ON PERFECTION

Perfection is reached notwhen there is no longeranything to add, but whenthere is no longer anythingto take away

- Antoine de Saint Exupery

5d

Page 21: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #6:

COMPUTER SCIENCE IS NOT SCIENCE

6

Page 22: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

SCIENCE

When God created the universe, like manyimplementers who came later, he did not

bother writing any documentation

6a

Page 23: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

ENGINEERINGENGINEERING

Computer science is really the engineering of abstract objects• Computer science is really the engineering of abstract objects• An engineer is someone who can do for a dime what any fool can do for a dollar

6b

Page 24: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

ENGINEERING ISSUES

• The design process (use tools)

• Tradeoffs (space/time, cost/performance, design time/quality)

• Good heuristics (e.g. 10% of the code = 90% of the time)

• Prototyping and measurement (lab courses are essential)

• Standards (don’t reinvent the wheel)

• Maintainability (by someone other than the programmer)

• Working in teams (software hut)

• Quality control (design for testability)

6c

Page 25: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #7:

THINK IN TERMS OF SYSTEMS

7

Page 26: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

AN EXAMPLE OF NOT THINKING ‘SYSTEMS’

• BART trains originally had drum brakes

• After the system was operational, they replaced all thedrum brakes by disk brakes

• Trains suddenly began vanishing at random from thecomputers that controlled the system

7a

Page 27: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

ANOTHER EXAMPLE OF NOT THINKING ‘SYSTEMS’

• One of my students wrote the MINIX mkfs (make filesystem) program with elaborate block caching

• This program normally runs for about 30 sec per year

• How much time could the block caching save?

• The block caching was so hairy, debugging took 6 months7b

Page 28: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

NEVER FORGET: THE USER IS PART OF THE SYSTEM

If the user hates your system, you have not done your

job well7c

Page 29: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

GOLDEN RULE #8:

KEEP THEORY UNDER CONTROL

8

Page 30: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

NONPROPOSAL TO NSF (PHYSICS DIVISION)

We propose to investigate the consequences

to the entire universe of assuming:

Budget required: $1,000,000 (first year)

8a8a

Page 31: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

‹date/time›

CS THEORISTS OFTEN IGNORE REALITY

• The banker’s algorithm for deadlock avoidance assumesthat all resource demands are known in advance

• Most CPU scheduling algorithms ignore the time requiredto switch between processes

• Some distributed algorithms assume that sending n 1-bytemessages takes the same time as 1 n-byte message

8b

Page 32: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

PROPER GOAL OF THEORY

The proper goal of theory in any field is to makemodels that accurately describe real systems. Thesemodels should help system builders do their jobs better

8c

Page 33: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

‹date/time›

GOLDEN RULE #9:

IGNORE HYPE

9

Page 34: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

EXAMPLES OF HIGHLY HYPED TOPICS

All of the following were once hyped as the solution to all your problems:

• Program correctness proofs• Fifth generation computers• Automatic program generators• The paperless office

• PL/I• Structured COBOL• Ada• Josephson junctions

9a

Page 35: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

‹footer›

GOLDEN RULE #10:

DON’T FORGET THE PAST

10

Page 36: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

AN OLD IDEA: VIRTUAL MACHINES (VM/370)

• VM/370 made it possible to separate multiprogrammingfrom the user OS, provide excellent protection, etc.

Virtual machine monitorrunning on the real hardwaresimulates three virtual 370sReal 370

Virtual370s

10a

Page 37: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

A NEW OLD IDEA: PENTIUM VIRTUAL 8086 MODE

• Virtual 8086 mode on the Pentium makes it possible torun old 16-bit DOS applications on a virtual machine

Real Pentium

Virtual 8086 Virtual 8086 Virtual 8086

10b

Page 38: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

TIMESHARING REVISITEDTIMESHARING REVISITED

• Timesharing was killed by the PC, but it is coming back10c

Page 39: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

ANOTHER OLD IDEA: INTERPRETATION

• In the days of yore, interpretive systems werecommon, for example, FORTH.

• As compilers got better, they passed out of fashion

• Now Java is making them popular again

10d

Page 40: TEN GOLDEN RULES FOR TEACHING COMPUTER ...jupiter.plymouth.edu/~wjt/Architecture/tannenbaum-talk.pdf• BART trains originally had drum brakes • After the system was operational,

SUMMARY

• Think long term

• Emphasize principles, not facts

• Expect paradigm shifts

• Explain how things work inside

• Show students how to master complexity

• Computer science is not science

• Think in terms of systems

• Keep theory under control

• Ignore hype

• Don’t forget the past11