The Point of This Course CS 5010 Program

The Point of This Course CS 5010 Program

The Point of This Course CS 5010 Program Design Paradigms Bootcamp Lesson 0.1 Mitchell Wand, 2012-2015 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. 1 Learning Objectives By the time you complete this lesson, you should be able to : Explain the point of the course list the 7 principles for writing beautiful programs

list the 6 steps of the design recipe recite some of the slogans that we will use throughout the course. 2 The Point 1. Its not calculus. Getting the right answer is not enough. 2. The goal is to write beautiful programs. 3. A beautiful program is one that is readable, understandable, and modifiable by people. 3

Your programs should look like this: source 4 Not like this source 5 Your programs should look like this source

6 Not like this source 7 And never, ever like this source 8 Seven Key Practices for Writing

Beautiful Programs 1. Write programs that people can read, understand, and modify. 2. Represent information as data; interpret data as information. 3. Use contracts and purpose statements to specify the intended behavior of your functions and methods. 4. Use invariants to limit your functions responsibility. 5. Use functions and methods that communicate by passing arguments and returning values 6. Use global side-effects only to share information between distant parts of the program. 7. Use interfaces to limit dependencies between different parts of your program.

9 The Key Practices in Action Everything we do can be traced back to one or more of these key practices. We will expand on each of them as we go along. Write these down, in your own handwriting. Writing things down will help you remember them. 10

The Function Design Recipe This recipe tells you the order in which to attack a programming problem. You need to do these steps in order: If you havent specified your data, you wont know what your data looks like or what it means. You cant write a function that does its job unless you know what its job is. 11 The Function Design Recipe 1. Data Design 2. Contract and Purpose Statement

3. Examples and Tests 4. Design Strategy 5. Function Definition 6. Program Review This is important. Write it down, in your own handwriting. Keep it with you at all times. Put it on your mirror. Put it under your pillow. Im not kidding! 12 A Few of Our Slogans We are also big on slogans. We think they help focus your mind. Here are our first few slogans. You should write

them down, too, in your own handwriting. In fact, whenever you see one of these blue tables, you should assume that this is something important, and you should probably write it down in your own handwriting so you can memorize it. 13 Some Slogans 1. Follow the recipe! 2. You don't understand it until you can give an example. 3. One function, one task. 4. The Shape of the Data Determines the Shape

of the Program. 5. Practice makes perfect. 14 The Course Map The course is divided into 3 main units: Basic Principles Tools and Techniques Object-Oriented Programming The first unit is taught in Racket; the second in a mixture of Racket and Java; and the third in Java. The map on the next slide, which we will show at

the beginning of every module, will help you see where you are in the course content. 15 Course Map Basic Principles Tools and Techniques Object-Oriented Programming Designing Data

Computing with Lists Interfaces and Classes Designing Functions Computing with Trees and Graphs

Inheritance Designing Systems Computing with Higher-Order Functions Objects with Mutable State Designing with Invariants

Efficiency, Part 2 Thinking about Efficiency 16 Course Map Basic Principles Tools and Techniques

Object-Oriented Programming Designing Data Computing with Lists Interfaces and Classes Designing Functions

Computing with Trees and Graphs Inheritance Designing Systems Designing with Invariants

Objects with Mutable State Thinking about Efficiency Efficiency, Part 2 17 Next Steps

If you have questions about this lesson, ask them on Piazza Go on to the next lesson 18

Recently Viewed Presentations

  • LAB AND SAFETY RULES - Wayne County School District

    LAB AND SAFETY RULES - Wayne County School District

    dok 2-pld-prof. lab work & homework complete writing all of computer safety rules in your notebook.—see thurs. handout. create an autobiography and turn in on friday test on friday computer safety rules- review info-test friday 8-10-12 computer safety rules what...
  • Hash Tables - Computer Science

    Hash Tables - Computer Science

    Hence, chaining is more common when keys have to be deleted. Computing Probe Sequences The ideal situation is uniform hashing: Generalization of simple uniform hashing. Each key is equally likely to have any of the m! permutations of 0, 1,…,...
  • Humans & Transformations Emily DiMaulo-Milk Emma Halecky Troy

    Humans & Transformations Emily DiMaulo-Milk Emma Halecky Troy

    Vocabulary cont. Vector- A quantity that has both direction and magnitude (NOTE: When a vector is written as vector PQ, P is the initial point and Q is the end point)Component Form (or Vector Form)- combines the horizontal and vertical...
  • The Critical Decision-Making Model The Critical Decision-Making Model

    The Critical Decision-Making Model The Critical Decision-Making Model

    The Critical Decision-Making Model. Ask yourself … What do I know about this incident (subject, victim, location)? What else do I need to know? What do my training and experience tell me about this type of incident? Step 1: Collect...
  • Electronic and Computer Systems Service - Cengage

    Electronic and Computer Systems Service - Cengage

    Title: Electronic and Computer Systems Service Last modified by: Rita Document presentation format: On-screen Show (4:3) Other titles: Arial MS Pゴシック Times New Roman Gilles Master Electronic and Computer Systems Service Objectives Introduction Inspection Sequence Perform Diagnostic Tests On-Board Diagnostics...
  • Getting started with myAccess - University of New South Wales

    Getting started with myAccess - University of New South Wales

    UNSW Data Classification Standard . for more information). Where can I go for help? If you have any questions or issues please contact the IT Service Centre on . [email protected] . or (02) 9385 1333. You can also bring your...
  • Chapter 51

    Chapter 51

    Overview: Shall We Dance? Animal behavior is based on physiological systems and processes. A . behavior. is the . nervous system's response . to a. stimulus. and is carried out by the . muscular. or the . hormonal. system. Behavior...
  • How do soils form?

    How do soils form?

    How do soils form? Processes. List the processes that occur in a soil? Give an example of each. Additions - rain adds water, dust adds minerals, as plants die and animals poop organic mater is added, humans also add fertilizer