programming and algorithms

web
 
guide to commenting code   ·   submitting code on d2l   ·   honesty   ·   grading

. Why get computers to do stuff?
Ever try to get a person to do something? What if they did it well? enjoyed it? will do it forever? BUT... you have to show them EVERY detail - just once. but EVERY DETAIL... Programming computers is like that - EVERY detail. It's like trying to get a small child to do something.

. What are algorithms? How do they fit in??
MOVE ME!!! R L F(n) lightbot | friend algorithm (Big Bang) How hard is it to tell the person what to do? Just because you can do it, can you tell somebody else? Average 3 Numbers? Even #? Tie Shoes? Ian's Shoelace Site Read Lips?

. Oh no! - they don't speak our language! We need a translator.
English ==> Franklineze ==> Eriez --------------------------------- We want to hire a guy from Erie to build a house for us. We speak English. Guy from Erie (a great builder) speaks Eriez - no English. Eriez is difficult! (just 'tics' and 'tocs'). Nobody here speaks Eriez - too hard to learn - impossible! BUT... A guy in Franklin speaks Eriez and Franklineze, but not English. Franklineze is pretty easy to learn - could we learn Franklineze ? Then we could tell the guy in Franklin to tell guy from Erie what to do!
English ==> C# ==> binary ------------------------- We want to "hire" the computer to do work for us. We speak English. The computer (a great worker) speaks binary - no English. Binary is difficult! (just ones and zeroes). Nobody here speaks binary - too hard to learn - impossible! BUT... The C# Compiler speaks binary and C#, but not English. C# is pretty easy to learn - could we learn C# ? Then we could tell the C# compiler to tell the computer what to do!

. Compiler is our translator
A compiler knows how to speak binary - NOT English!
But it knows C++, C#, VB, Java, Pascal, FORTRAN, COBOL, etc...
Algorithm in English -> Program Code -> Compiler -> Binary Code -> Computer C# Say "hello" ==> System.Console.WriteLine("hello"); ==> 010010010010... C++ Say "hello" ==> cout << "hello" << endl; ==> 010010010010...
Problems: Constructing the algorithm Logic errors Constructing the program Syntax errors
Developers use a tool called Visual Studio to write Visual C# programs. It is an integrated development environment (IDE). Provides services and tools that enable a developer to code, test, and implement a single program or series of programs. net Compile and link (In C#: Choose "Build" from the menu bar) ================ 1. SYNTAX is checked (parsed) reads code one symbol at a time (how does it separate symbols?) 2. BINARY CODE is generated (if parsed successfully) - generates equivalent binary code in an object file 3. LIBRARIES are linked in to create the executble program file libraries have other code that your program uses

If code compiles, is it safe to assume it will run correctly?

  .NET Class Library

The class library is used by programmers, who combine it with their own code to produce applications. A class is a named group of program code - a button is an example A class is also a "blueprint" A class library stores the class and makes the class available to developers who need it A button created from a class is called an object, a control, or sometimes an instance of a class The process of creating a Button object from the Button class is called instantiation.

  Common Intermediate Language (CIL) / Common Language Runtime (CLR)

Compilation translates programming statements into instructions that can be understood by the electronics of the computer Compilation for a VC# program creates a set of electronic code expressed in an intermediate language called the Common Intermediate Language (CIL) [ was called MSIL ]. When the program is executed, a portion of .NET called the Common Language Runtime (CLR) reads the CIL and causes the instructions within the program to be executed.

. How did software evolve?
Ultimately all SW becomes ______ code
first programmers
1. hardwired program changes switches on/off idea!! specify switch state by storing a 1 or 0!! 2. program in machine language 3. assembly language programming 4. What is HOL? (50's) What is a compiler? Two BIG advantages of HOL: - easier to program in HOL - why? - easier to port - why? evolution