004 Basic programming method

I. Summary

  1. Computer and Programming
  2. Compiled and interpreted
  3. The basic method for the preparation of the program
  4. Computer Programming

Second, the computer and program design

2.1 computer

The computer is a device operating according to the instruction data

  • Functionality: operation on the data, the performance data is calculated, and output the processing result storage,
  • Programmability: automatically, predictably and accurately in accordance with the operator's intention to complete the series of instructions

2.2 Development of computer

Referring to Moore's Law of computer development, performance exponentially

  • Computer hardware reference scale integrated circuit depends Moore's Law
  • Computer speed and therefore close to the rapid growth in geometric progression
  • Efficient operation of various types of computer support function continuously enrich and develop

2.3 Moore's Law Moore's Law

Computer development in the history of the most important prediction rules

  • Gordon Moore, one of Intel co-founder made in 1965
  • Number per unit area on an integrated circuit transistor can accommodate about every two years
  • CPU / GPU, memory, hard drives, electronic products and so prices follow Moore's Law

The real world of Moore's Law:

004 Basic programming method -01.jpg? X-oss-process = style / watermark

Computer 2.4 development

Referring to Moore's Law of computer development, performance exponentially

  • In today's world, the only effective and up to 50 years of development in accordance with the technical field index
  • Computer profound change in human society, and may even change humanity itself
  • Foreseeable future 30 years, Moore's Law will continue effective

2.5 Programming

Computer programming is reflected programmability

  • The main means of programming, also known as programmed, the depth of the computer application
  • Programming has become one of the largest vocational skills in demand in today's society
  • Many jobs will be taken over by a computer program, program design will be survival skills

2.6 programming language

Programming language is an artificial language for interactive (exchange) of

  • Programming language, also known as programming languages, programming of specific implementations
  • Programming language is simpler compared to natural language, more rigorous, more accurate
  • The main programming language for the interaction between humans and computers

Programming language a lot, but not many strong vitality

  • There are more than 600 kinds of programming languages, most of them no longer in use
  • C language was born in 1972, it was the first widely used programming language
  • Python language was born in 1990, it is best to use the most popular programming languages

Third, compiled and interpreted

3.1 programming language implementation

Two ways to perform the computer source code: compiled and interpreted

  • Source: using a computer program written in a programming language, human-readable, for example:result = 2 + 3
  • Object code: The computer can be executed directly, human-unreadable (other than an expert), for example:11010010 00111011

3.2 compiler

Converting source code into object code disposable procedure:

004 Basic programming method -02.jpg? X-oss-process = style / watermark

Program execution compilation process is called a compiler

3.3 explanation

The process converts the source code into object code by one at the same time by one operation of:

004 Basic programming method -03.jpg? X-oss-process = style / watermark

Explain the program execution procedure called interpreter

3.4 compiled and interpreted

  • Compiler: a one-time translator, after no longer need the source code (similar to the English translation)
  • Explanation: With each translation with the implementation of the program is running (similar to the real-time simultaneous interpretation)

3.5 Static and dynamic languages

Depending on the implementation, programming languages ​​fall into two categories

  • Static language
    • Use compiler implementation of programming languages ​​such as C / C ++ language, Java language
    • The compiler generates object code one-off, to more fully optimize the program run faster
  • Scripting language
    • Use interpreted programming language, Python language, JavaScript language, PHP language
    • Need the source code for the implementation of the program, to maintain a more flexible, flexible source code maintenance, across multiple operating system platforms

Fourth, the basic method for the preparation of the program

4.1 IPO

The basic method for the preparation of the program

  • I: Input Input input, the program
  • Process main logic processing program: P
  • O: Output output, the output of the program

4.2 understand IPO

  • Entry
    • Enter the program: file input, network input, console input, the input interface, the internal parameter input, etc.
    • Enter the beginning of a program
  • Export
    • Output of the program: console output, graphics output, file output, the output of the network, operating system and other internal variable output
    • The output is the result of the calculation program shows the way
  • deal with
    • Process is a process program input data is calculated to produce the output
    • Processing method referred to as algorithms, it is the most important part of the program
    • Algorithm is the soul of a program

Calculating section 4.3 problem

A problem to be solved, you can use the auxiliary program partially completed

  • The computer can only solve computational problems, that is part of the problem of computing
  • There may be a variety of angles problem understood produce different calculation section
  • Part of the problem is generally calculated input, process and output process

4.4 programming steps to solve the problem

Step 6 (1-3)

  • Analysis of the problem: the calculation part of the analysis of the problem, think clearly
  • Demarcation of the border: the function of border demarcation issues, planning IPO
  • Design algorithms: algorithm design problems, concerns algorithms

Use computers to solve problems

  • Write a program: computing programming problem, programmed
  • Debug Test: run the debugger correctly, run the debugger
  • Maintenance Upgrade: Upgrade adaptation of maintenance, updated sound

4.5 solving computational problems streamlining steps

3 steps to streamline

  • OK IPO: explicit calculation part and functional boundaries
  • Write a program: the numerical solution of the design into reality
  • Debugger: Ensure that the program can run properly in the correct logic

Fifth, computer programming

5.1 program to train thinking

  • Programming reflects an abstract interactions, automated execution mode of thinking
  • Thinking calculated: the difference between a third logical thinking and thinking positive thinking
  • To promote human thinking, enhance observation and deepen understanding of the interactions of

5.2 Programming can raise awareness

  • Programming is not simply to solve computational problems
  • Not only to think about solutions, but also think the user experience, efficiency, etc.
  • It can help programmers to deepen user behavior as well as social and cultural awareness

5.3 Programming can be fun

  • Programming can provide ideas and demonstrate their ability to stage
  • Let the world adding new colors, allow yourself to become cooler, enhance psychological satisfaction
  • Innovative thinking in the information space, innovation into reality

5.4 Programming can improve efficiency

  • We can make better use of computers to solve problems
  • Significantly improve the working, living and learning efficiency
  • Provide an efficient means of using computer to achieve personal goals

5.5 Programming bring jobs

  • Programmer is one of the most important information age jobs
  • Domestic and foreign notch programmer jobs are more than one million scale
  • Computers have permeated all sectors, employment prospects are very bright

5.6 learning programming errors

Q: programming is difficult to learn? A: The method is very easy to master!

  • First, master the syntax of a programming language, familiar with the basic concepts and logic
  • Secondly, the calculation of thinking about program structure, will use programming routines
  • Finally, referring to cases of more practice and more practice, learn by analogy

VI Summary

  • Functionality of the computer and programmability
  • Compiled and interpreted, static and scripting languages
  • Calculating section IPO, to understand the problem
  • Grasp the value of computer programming

Guess you like

Origin www.cnblogs.com/nickchen121/p/11164043.html