Agenda - What the module is all about.
- Assessment.
- What is programming?
- What is hardware, an operating system, software?
- What is a computer language?
What the module is all about. - By the end of the module you should be able to write reasonably sized VB.NET programs
- You should have a solid basis of how programming works (Principles)
- The latter will allow you to explore VB.NET yourself in greater details, or EVEN to learn a new language independently!
About The Module - Assignments
- Practical tests (computer-lab)
- Tutor
- Senior Lecturer
- Westminster International University in Tashkent
What is a Computer? - Computers can handle repetitive chores without becoming bored or exhausted.
- A computer is programmable to handle different tasks:
- Financial calculations
- Processing words
- Playing games
- Computer actions are composed of huge numbers of extremely primitive operations
- The computer gives the illusion of smooth interaction because it executes these operations with a great speed.
- Computers are flexible: they can handle a wide range of tasks.
What is Programming? - A program tells the computer the sequence of steps needed to fulfill a task.
- A programmer designs and implements these programs.
- Most computer users are not computer programmers.
- Programming is an essential skill for a computer scientist.
What is a Computer Language? - A special language that allows people to communicate with computers
- Modern computer languages use words from human languages, have rules of grammar, syntax and punctuation
- In general, programming language is a way to say to a computer what to do
(CPU, Memory, and bus) - CPU (Central Processing Unit):
- Plastic, metal and mostly silicon.
- Composed of several million transistors.
- Enormously complicated wiring.
- Performs program control, arithmetic, and data movement.
- Locates and executes program instructions.
- Memory:
- RAM (Random Access Memory): read-write memory.
- ROM (Read Only Memory): contains certain programs that must always be present.
- Secondary storage
- (e.g. a hard drive) provides persistent storage.
- Bus
- is a set of electrical lines that connect the CPU, RAM, and other devices.
The Anatomy of a Computer Programming languages: 1st Generation - Machine instructions:
- 161 40000 45 100 127 11280
- Tedious and error prone to look up numeric codes and enter them manually.
- Each processor has its own set of machine instructions.
Programming languages: 2nd Generation - Assembler
- One-to-one correspondence with instructions
- Assigns short names to commands:
- mov 40000, %eax
- sub 100, %eax
- Makes reading easier for humans
- Translated into machine instructions by another program
- Still processor dependent
Programming languages: 3rd Generation - Higher-level languages:
- Independent of the underlying hardware
- Easiest for humans to read and write
- if (int_rate > 100)
- MessageBox("Interest rate error");
- Translated by compilers into machine instructions
Programming languages: 4th Generation - Indicates “What to do” rather then “How to do that”
- SQL, Report generators
Compiled languages vs. Interpreted - Compiler converts source code into machine-specific instructions BEFORE execution (at compile time)
- Faster execution
- Need to recompile to make changes
- C++, .Net, Java
- Interpreter converts source code into processor-specific instructions DURING the execution (run-time, just-in-time)
- Slower execution
- Allows to change code at run-time
- PHP, JavaScript
- The Compilation Process (Diagram)
The Compilation Process (Definitions) - You write source code - that is your program
- The compiler is a program that translate your source code into object code
- Object code consists of machine instructions and information on how to load the program into memory
- A linker program takes the object code from your program and the code from the various libraries and builds them into an executable file
- Libraries contain the (already translated) code used by your program (such as System.Data)
The need to abstract the operating system .Net Compilation (schematic) - Microsoft Intermediate Language
- CLR just in-time compiler
Do'stlaringiz bilan baham: |