computer_basics:programming_fundamentals
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
computer_basics:programming_fundamentals [2018/08/23 01:37] – [What programmers do] mithat | computer_basics:programming_fundamentals [2019/01/12 02:32] (current) – [High-level languages] mithat | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== What is programming? | ===== What is programming? | ||
- | * **programming**: | + | * **programming**: |
* **computer program**: | * **computer program**: | ||
* a set of step-by-step instructions | * a set of step-by-step instructions | ||
Line 16: | Line 16: | ||
===== What programmers do ===== | ===== What programmers do ===== | ||
- | * Write new programs. | + | * "Write programs" |
* Prepare the instructions of a computer program. | * Prepare the instructions of a computer program. | ||
* Test and correct programs. | * Test and correct programs. | ||
Line 27: | Line 27: | ||
* a set of rules used to write computer programs. | * a set of rules used to write computer programs. | ||
* a way of telling the computer what operations to perform. | * a way of telling the computer what operations to perform. | ||
- | + | | |
- | | + | * Use only ON/OFF switches to control internal states. |
- | * Use only ON/OFF switches to control internal states | + | |
* Only understand instructions that are expressed in ON/OFF (or 1/0) terms. | * Only understand instructions that are expressed in ON/OFF (or 1/0) terms. | ||
- | * To make it easier for humans to program computers, various programming languages have been invented. | + | * Programming languages have been invented to make it easier for humans to write programs. |
===== Levels of language ===== | ===== Levels of language ===== | ||
Line 47: | Line 46: | ||
===== Machine language ===== | ===== Machine language ===== | ||
- | | + | < |
- | * Consists of 1’s and 0’s. | + | 10110110100100101101011101001010 |
+ | 10110110110101101101011011000111 | ||
+ | </ | ||
+ | |||
+ | | ||
+ | * Just 1’s and 0’s. | ||
+ | * Very hard not to make a mistake. | ||
* Each type of computer processor has its own machine language. | * Each type of computer processor has its own machine language. | ||
===== Assembly language ===== | ===== Assembly language ===== | ||
- | | + | < |
- | * '' | + | MOV AL, 1h |
- | * An **assembler** program converts | + | MOV CL, 2h |
+ | MOV DL, 3h | ||
+ | </ | ||
+ | |||
+ | | ||
+ | * '' | ||
+ | * **Assembler** program converts assembly language | ||
===== High-level languages ===== | ===== High-level languages ===== | ||
+ | < | ||
+ | if score > 60: | ||
+ | print(' | ||
+ | else: | ||
+ | print(' | ||
+ | </ | ||
- | * Use general notation systems that most humans can understand. | + | * Uses math-like or English-like notation systems. |
- | * Often English-like or math-like. | + | * Allows programmer to think less about language details and more about solving |
- | * Much more convenient to write and repair. | + | * Portability |
- | * Allows programmer to think less about language details and more about solving | + | |
- | * "Write once, run anywhere." | + | |
===== Very high-level languages ===== | ===== Very high-level languages ===== | ||
Line 72: | Line 87: | ||
* Tries to let people program using everyday language. | * Tries to let people program using everyday language. | ||
- | * "Show a list of names from the contact list," | + | * "Show a list of names from the contact list," |
===== Kinds of translation ===== | ===== Kinds of translation ===== | ||
* High-level languages need to be **translated** into machine language. | * High-level languages need to be **translated** into machine language. | ||
- | * Three approaches | + | * Three approaches: |
* **interpreted**: | * **interpreted**: | ||
- | * **compiled**: | + | * **compiled**: |
* **hybrid**: translate the whole program into an in-between language; execute the in-between language in an interpreter. | * **hybrid**: translate the whole program into an in-between language; execute the in-between language in an interpreter. | ||
Line 119: | Line 134: | ||
* **documentation**: | * **documentation**: | ||
- | * Many languages let you include some documentation in the program code. | + | * Most languages let you include some documentation in the program code. |
* Documentation is needed: | * Documentation is needed: | ||
* to help organize program planning | * to help organize program planning |
computer_basics/programming_fundamentals.txt · Last modified: 2019/01/12 02:32 by mithat