770 likes | 992 Views
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.
E N D
Programming Fundamentals Feliks Kluźniak Programming fundamentals
Executive summary: This is a short overview of the course. Programming fundamentals
The purpose of this course is to teach you the basic concepts and techniques that are fundamental to programming. Programming fundamentals
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
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
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
There are at least three reasons why you might be interested in the fundamentals of programming: Programming fundamentals
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
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
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
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
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
A few words about the contents of this course. Programming fundamentals
“Programming fundamentals” is not the same as “learning to write very simple programs in Java”. Programming fundamentals
“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
“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
“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
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
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
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
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
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
In order to use the operational view, we must understand how a computer works. Programming fundamentals
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
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
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
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
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
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
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
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
The operational view is the one that is the most commonly used. For many programmers it is the only one. Programming fundamentals
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
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
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
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
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
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
To use the static view we must know a little bit about sets and predicate calculus. Programming fundamentals
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
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
An ability to understand programs is not enough: we must also be able to write them. Programming fundamentals
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
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
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
Because it is so challenging, programming can be tremendously satisfying: it is simply great fun! Programming fundamentals
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
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
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
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