programming fundamentals n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Programming Fundamentals PowerPoint Presentation
Download Presentation
Programming Fundamentals

Loading in 2 Seconds...

play fullscreen
1 / 72

Programming Fundamentals - PowerPoint PPT Presentation


  • 143 Views
  • Uploaded on

Programming Fundamentals. Feliks Klu ź niak. Executive summary: This is a short overview of the course . The purpose of this course is to teach you the basic concepts and techniques that are fundamental to programming.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Programming Fundamentals' - satya


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
programming fundamentals

Programming Fundamentals

Feliks Kluźniak

Programming fundamentals

slide2

Executive summary:

This is a short overview of the course.

Programming fundamentals

slide3

The purpose of this course is to teach you the basic concepts and techniques that are fundamental to programming.

Programming fundamentals

slide4

The purpose of this course is to teach you the basic concepts and techniques that are fundamental to programming.

There are two pre-requisites:

Programming fundamentals

slide5

The purpose of this course is to teach you the basic concepts and techniques that are fundamental to programming.

There are two pre-requisites:

you must be able to read;

Programming fundamentals

slide6

The purpose of this course is to teach you the basic concepts and techniques that are fundamental to programming.

There are two pre-requisites:

you must be able to read;

you must have some interest in the subject matter.

Programming fundamentals

slide7

There are at least three reasons why you might be interested in the fundamentals of programming:

Programming fundamentals

slide8

There are at least three reasons why you might be interested in the fundamentals of programming:

you want to be a programmer, i.e., to construct software;

Programming fundamentals

slide9

There are at least three reasons why you might be interested in the fundamentals of programming:

you want to be a programmer, i.e., to construct software;

you want to just use software, but would like to understand what is “under the hood”;

Programming fundamentals

slide10

There are at least three reasons why you might be interested in the fundamentals of programming:

you want to be a programmer, i.e., to construct software;

you want to just use software, but would like to understand what is “under the hood”;

you want to understand the nature and limitations of computers and software, because they are such a pervasive phenomenon in contemporary culture.

Programming fundamentals

slide11

There are two pre-requisites:

you must be able to read;

you must have some interest in the subject matter.

Those of you who had some prior exposure to programming should not assume that they have an advantage! Some things may have to be unlearnt….

Programming fundamentals

slide12

There are two pre-requisites:

you must be able to read;

you must have some interest in the subject matter.

There is one co-requisite:

you must be enrolled in “my” section of CS 1136

(date to be determined when we next meet).

Programming fundamentals

slide14

“Programming fundamentals”

is not the same as

“learning to write very simple programs in Java”.

Programming fundamentals

slide15

“Programming fundamentals”

is not the same as

“learning to write very simple programs in Java”.

The goal is to make you understand the basic principles of imperative programming.

Programming fundamentals

slide16

“Programming fundamentals”

is not the same as

“learning to write very simple programs in Java”.

The goal is to make you understand the basic principles of imperative programming.

Once you know the principles, you can learn a new language (Java, C, Python, whatever the future brings) on your own.

Programming fundamentals

slide17

“Programming fundamentals”

is not the same as

“learning to write very simple programs in Java”.

The goal is to make you understand the basic principles of imperative programming.

Once you know the principles, you can learn a new language (Java, C, Python, whatever the future brings) on your own.

Please note that we will not be using Java in this course: if you do well, you will be well ahead of those who did use Java. But if this fact bothers you, you might want to switch to a different section.

Programming fundamentals

slide18

The goal is to understand programming and programs.

There are two principal ways to understand a program: the “operational” view and the “static” (or “logical” view).

Programming fundamentals

slide19

In the operational view, a program is seen as that which directs a computer. We understand the program through the lens of the computations to which it can lead.

Programming fundamentals

slide20

In the operational view, a program is seen as that which directs a computer. We understand the program through the lens of the computations to which it can lead.

  • This view is important, because:
  • it helps guide our intuition;

Programming fundamentals

slide21

In the operational view, a program is seen as that which directs a computer. We understand the program through the lens of the computations to which it can lead.

  • This view is important, because:
  • it helps guide our intuition;
  • it helps us understand various data structures;

Programming fundamentals

slide22

In the operational view, a program is seen as that which directs a computer. We understand the program through the lens of the computations to which it can lead.

  • This view is important, because:
  • it helps guide our intuition;
  • it helps us understand various data structures;
  • it helps us understand computational complexity
  • (i.e., the “cost” of executing the program).

Programming fundamentals

slide23

In order to use the operational view, we must understand how a computer works.

Programming fundamentals

slide24

In order to use the operational view, we must understand how a computer works.

In order to understand how a computer works, we must:

Programming fundamentals

slide25

In order to use the operational view, we must understand how a computer works.

  • In order to understand how a computer works, we must:
  • understand binary arithmetic;

Programming fundamentals

slide26

In order to use the operational view, we must understand how a computer works.

  • In order to understand how a computer works, we must:
  • understand binary arithmetic;
  • understand the basic functional units of a computer;

Programming fundamentals

slide27

In order to use the operational view, we must understand how a computer works.

  • In order to understand how a computer works, we must:
  • understand binary arithmetic;
  • understand the basic functional units of a computer;
  • understand the basic cycle of a CPU;

Programming fundamentals

slide28

In order to use the operational view, we must understand how a computer works.

  • In order to understand how a computer works, we must:
  • understand binary arithmetic;
  • understand the basic functional units of a computer;
  • understand the basic cycle of a CPU;
  • gain some basic experience with programming
  • in “machine language”.

Programming fundamentals

slide29

In order to use the operational view, we must understand how a computer works.

  • In order to understand how a computer works, we must:
  • understand binary arithmetic;
  • understand the basic functional units of a computer;
  • understand the basic cycle of a CPU;
  • gain some basic experience with programming
  • in “machine language”.
  • In general, it is quite impossible to really understand anything about computers and programming without “getting your hands wet”. Hence the importance of the lab (CS 1136).

Programming fundamentals

slide30

In order to use the operational view, we must understand how a computer works.

We must also understand how the various constructs of a high level (imperative) programming language map onto the level of the machine.

Programming fundamentals

slide31

In order to use the operational view, we must understand how a computer works.

We must also understand how the various constructs of a high level (imperative) programming language map onto the level of the machine.

This will also help us understand the language and to use it more effectively.

Programming fundamentals

slide32

The operational view is the one that is the most commonly used. For many programmers it is the only one.

Programming fundamentals

slide33

The operational view is the one that is the most commonly used. For many programmers it is the only one.

But it is not sufficient. We will see why this is so.

Programming fundamentals

slide34

The operational view is the one that is the most commonly used. For many programmers it is the only one.

But it is not sufficient. We will see why this is so.

To program really effectively, we must also use the “static” (or “logical”) view.

Programming fundamentals

slide35

In the static view, a computation is seen as a traversal of a statespace.

Various sets of “places” in the state space are described by predicates.

Programming fundamentals

slide36

In the static view, a computation is seen as a traversal of a statespace.

Various sets of “places” in the state space are described by predicates.

A program is seen as a formula that transforms one predicate into another: this corresponds to moving from one subset of the state space to another.

Programming fundamentals

slide37

In the static view, a computation is seen as a traversal of a statespace.

Various sets of “places” in the state space are described by predicates.

A program is seen as a formula that transforms one predicate into another: this corresponds to moving from one subset of the state space to another.

The details of the computation are immaterial: it is the effect that counts.

Programming fundamentals

slide38

In the static view, a computation is seen as a traversal of a statespace.

Various sets of “places” in the state space are described by predicates.

A program is seen as a formula that transforms one predicate into another: this corresponds to moving from one subset of the state space to another.

The details of the computation are immaterial: it is the effect that counts.

This drastically reduces the difficulty of reasoning about the program!

Programming fundamentals

slide39

To use the static view we must know a little bit about sets and predicate calculus.

Programming fundamentals

slide40

To use the static view we must know a little bit about sets and predicate calculus.

Since predicate calculus courses come rather late in the curriculum, we will have a crash course about the most important aspects: this will stretch your brains a little bit!

Programming fundamentals

slide41

To use the static view we must know a little bit about sets and predicate calculus.

Since predicate calculus courses come rather late in the curriculum, we will have a crash course about the most important aspects: this will stretch your brains a little bit!

The good new is that elementary knowledge of predicate calculus is quite necessary in many professions and in everyday life. So your effort will not have been wasted.

Programming fundamentals

slide42

An ability to understand programs is not enough: we must also be able to write them.

Programming fundamentals

slide43

An ability to understand programs is not enough: we must also be able to write them.

The static view is an effective tool that helps us to methodically construct programs that “work” as expected.

Programming fundamentals

slide44

An ability to understand programs is not enough: we must also be able to write them.

The static view is an effective tool that helps us to methodically construct programs that “work” as expected.

The fact that the static view is more intellectually challenging is not a good reason for abandoning it.

Programming fundamentals

slide45

An ability to understand programs is not enough: we must also be able to write them.

The static view is an effective tool that helps us to methodically construct programs that “work” as expected.

The fact that the static view is more intellectually challenging is not a good reason for abandoning it: programming is one of the most challenging activities known to humankind, and ignoring this fact will get us nowhere.

Programming fundamentals

slide46

Because it is so challenging, programming can be tremendously satisfying: it is simply great fun!

Programming fundamentals

slide47

Because it is so challenging, programming can be tremendously satisfying: it is simply great fun!

But if we do not do it properly, it quickly becomes a nightmare.

Programming fundamentals

slide48

Because it is so challenging, programming can be tremendously satisfying: it is simply great fun!

But if we do not do it properly, it quickly becomes a nightmare.

The main goal of this introductory course is to help you appreciate the fun while learning to avoid the nightmare!

Programming fundamentals

slide49

Because it is so challenging, programming can be tremendously satisfying: it is simply great fun!

But if we do not do it properly, it quickly becomes a nightmare.

The main goal of this introductory course is to help you appreciate the fun while learning to avoid the nightmare!

But it will require hard work!

Programming fundamentals

slide50

Because it is so challenging, programming can be tremendously satisfying: it is simply great fun!

But if we do not do it properly, it quickly becomes a nightmare.

The main goal of this introductory course is to help you appreciate the fun while learning to avoid the nightmare!

But it will require hard work!

The course is not difficult, but there are many new

concepts that will expand your mind: expanding

your mind does not come easily.

Programming fundamentals

slide51

Because it is so challenging, programming can be tremendously satisfying: it is simply great fun!

But if we do not do it properly, it quickly becomes a nightmare.

The main goal of this introductory course is to help you appreciate the fun while learning to avoid the nightmare!

But it will require hard work!

The course is not difficult, but there are many new

concepts that will expand your mind: expanding

your mind does not come easily.

But then, isn’t that what education is all about?

Programming fundamentals

slide52

So, there will be three groups of topics:

understanding a computer (from the programmer’s perspective);

Programming fundamentals

slide53

So, there will be three groups of topics:

understanding a computer (from the programmer’s perspective);

understanding the principles of imperative programming in a high-level language;

Programming fundamentals

slide54

So, there will be three groups of topics:

understanding a computer (from the programmer’s perspective);

understanding the principles of imperative programming in a high-level language;

understanding the basic principles of how to reason about programs and how to construct them effectively.

Programming fundamentals

slide55

1. Understanding a computer:

    • binary arithmetic;
    • a very simple machine, and how it works;
    • a little help in avoiding drudgery: an assembler;
    • taming complexity by using subroutines;
    • opportunity to practice simple programming in a simple assembler (“machine language”).

Programming fundamentals

slide56

2. A generic imperative high-level language:

    • basic control constructs;
    • functions and procedures, recursion;
    • basic data structures:
        • arrays;
        • records;
        • using pointers to construct:
          • trees;
          • linked lists.

Programming fundamentals

slide57

2. A generic imperative high-level language:

    • basic control constructs;
    • functions and procedures, recursion;
    • basic data structures:
        • arrays;
        • records;
        • using pointers to construct:
          • trees;
          • linked lists.

PLUS: elementary notions of object-oriented

programming.

Programming fundamentals

slide58

3. Reasoning about programs and how to construct

  • them (concurrently with 2):
    • why operational thinking is not enough;
    • the concept of a state space, computation as
  • a traversal of the space;
    • elementary predicate calculus, with notation
  • that is custom-made to help in programming;
    • basic ways to reason about a program;
    • what to think about when we construct a program.

Programming fundamentals

slide59

So much for what we are going to do.

Now a few words about how:

Programming fundamentals

slide60

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Programming fundamentals

slide61

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

Programming fundamentals

slide62

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

This is like climbing a mountain, or a long ladder.

Programming fundamentals

slide63

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

This is like climbing a mountain, or a long ladder.

If you do it systematically, it is no big deal.

Programming fundamentals

slide64

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

This is like climbing a mountain, or a long ladder.

If you do it systematically, it is no big deal.

If you must run to catch up, your heart may fail.

Programming fundamentals

slide65

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

This is like climbing a mountain, or a long ladder.

If you do it systematically, it is no big deal.

If you must run to catch up, your heart may fail.

If you try to take shortcuts, you may fall off and kill yourself.

Programming fundamentals

slide66

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

Allocate enough time for this, up front.

Programming fundamentals

slide67

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

Allocate enough time for this, up front. Always preview the slides from a lecture before the next lecture, so that you come prepared.

Programming fundamentals

slide68

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

Know that:

-- cheating can only get you into trouble

Programming fundamentals

slide69

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

Know that:

-- cheating can only get you into trouble;

-- there are no answers on the web: you simply

have to understand and practice, or you will fail.

Programming fundamentals

slide70

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

Do not be afraid to ask questions!

Programming fundamentals

slide71

So much for what we are going to do.

Now a few words about how:

You must attend the associated lab, which is an integral part of this course. It must be the section(s) that bears my name as the instructor.

Do not postpone studying until later. If you are not constantly abreast with the course, you will not benefit from it!

Do not be afraid to ask questions!

Do take advantage of my office hours: I am here to

help you!

Programming fundamentals

slide72

Main points:

  • If you want to learn more and get ahead of the pack, this is the course for you; if you don’t, you might be better off attending another section.
  • If you choose to attend, make sure the lab section has the same instructor as the course section.

Programming fundamentals