Overview of Programming
- A Note on terms:
- I expect you to learn the terms (definitions) used in this class.
- You don't need to memorize them, altho this is sometimes very helpful
- You do need to know what they mean.
- A note on notes:
- These notes are my talking points in class.
- They are mostly an outline of the book
- Use them, if you wish, but they are likely to contain errors,
that hopefully will be corrected in class.
- You should always read the book.
- They might explain things better than I.
- You paid for it, use it.
- Computer:
- A programmable electronic device which can store, process and
retrieve data.
- More later, in this and other classes.
- Data and Information
- Information - knowledge that can be communicated.
- Data - information in a form that the computer can use.
- A program
- A set of instructions to solve a problem
- How do you send a USPS letter?
- Get an envelope
- Write the return address on the upper left hand corner
- Write the address on the middle
- Place a stamp in the upper right hand corner
- Place the letter inside of the envelope
- Seal the envelope.
- Place the envelope at an approved USPS pickup point
- Notice the order is, at times, important here.
- Notice, as well, that we could give bad instructions:
- Get an envelope
- Place the envelope at an approved USPS pickup point
- Write the address on the upper left hand corner
- Write the return address on the middle
- Place a stamp in the upper right hand corner
- Seal the envelope.
- Place the letter inside of the envelope
- A note on examples:
- Whenever possible, I try to make an example that is different
from that in the book.
- I feel that this gives you multiple views of the same problem.
- You should make sure that you understand both.
- We do this all of the time with multiple tasks.
- Programming is the act of creating a program.
- How do you do this?
- Three Phases
- Problem solving Phase
- Analysis and Specification
- General Solution (algorithm)
- Verify
- Implemetation Phase
- Maintenance Phase
-
- DOCUMENTATION IS REQUIRED AT ALL PHASES
- An algorithm is a step by step procedure for solving a
problem is a finite amount of time.
- Finite is important here.
- Again, we will deal with this later, but we want to konw that
it is possible to finish the task.
- Programming Language
- A set of rules, symbols and special words used to construct
a computer program.
- ?
- We don't use natural languages (English, German ...)
- They are too imprecise.
- Too many ways to say something
- Too many different meanings for a given phrase
- "You should attend class"
- There are many different languages
- Each with a different idea, slant, job
C, C++, Fortran, Java, COBOL, ...
- They tend to be :
- Limited in vocabulary
- Very strict in syntax
- Simple and small
- Translating an algorithm into a programming language is called coding
- Fixing mistakes in the program or code is called debugging
- Two basic types of mistakes
- Syntax errors - you said it wrong
- Logic errors - you said it right, but what you said is wrong.
- Even with the restrictions above, different people tend to produce
different code.
- One of the goals of this class is to help you develop a good
programming style
- The book has one style
- I will tend to use another.
- Pick what you like, take what you must.