1 / 72

Programming Fundamentals

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.

satya
Download Presentation

Programming Fundamentals

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming Fundamentals Feliks Kluźniak Programming fundamentals

  2. Executive summary: This is a short overview of the course. Programming fundamentals

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

  4. 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

  5. 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

  6. 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

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

  8. 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

  9. 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

  10. 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

  11. 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

  12. 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

  13. A few words about the contents of this course. Programming fundamentals

  14. “Programming fundamentals” is not the same as “learning to write very simple programs in Java”. Programming fundamentals

  15. “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

  16. “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

  17. “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

  18. 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

  19. 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

  20. 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

  21. 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

  22. 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

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

  24. 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

  25. 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

  26. 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

  27. 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

  28. 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

  29. 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

  30. 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

  31. 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

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

  33. 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

  34. 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

  35. 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

  36. 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

  37. 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

  38. 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

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

  40. 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

  41. 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

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

  43. 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

  44. 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

  45. 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

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

  47. 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

  48. 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

  49. 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

  50. 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

More Related