Although the computer is very powerful. It can be used for you to surf the Internet, play games and manage the company's personnel relations. But without a program, it is equivalent to a pile of scrap iron and will not pay attention to the "orders" we give it. Therefore, we can only tame it in one way-program, which is the only way for us to communicate with computers.
What exactly is the procedure?
A program is a collection of instructions that tell a computer how to perform a special task.
For example, it is like guiding you to make a menu, or directing a traffic policeman (or a traffic sign) to drive all the way to the destination. Without these special instructions, the expected task will not be carried out. So is the computer. When you want a computer to do something for you, the computer itself can't actively work for us, so we have to give it instructions, and it can't and can't understand the description of things in human natural language at all, so we have to tell the computer what to do and how to do it with programs. Even the simplest tasks need instructions, such as how to get keystrokes, how to put a letter on the screen, how to save files on disk, and so on.
So much trouble, even programming these things should be considered! No wonder some people say that programming is so difficult! You are wrong. In fact, many of these instructions are ready-made, contained in the processing chip and embedded in the operating system, so we don't have to worry about their work. It's all done by the processor and the operating system, and we don't need to get involved in these processes.
The computer mentioned above will not do anything on its own initiative. Therefore, we should make the computer "serve" for us through the program. And this process is made up by ourselves. Programming can be realized by using a programming language, and what the computer is required to do is described according to the grammar of this language.
The grammar we are talking about here is completely different from that in a foreign language. The grammar we are talking about here is just reading your program and writing rules.
After writing the program, special software will interpret or translate your program into a "computer language" that the computer can recognize, and then the computer can "understand" your words and do things according to your instructions. So programming is actually a process of "people making rules for computers".
There are many kinds of computer languages, which can be generally divided into three categories: machine language, assembly language and high-level language.
Every action and step of a computer is carried out according to a program written in computer language. A program is a collection of instructions that a computer needs to execute. All programs are written in the language we have mastered. Therefore, if people want to control the computer, they must send commands to the computer through computer language.
The only language that a computer can recognize is machine language, that is, machine language. But usually people don't use machine language when programming, because it is very difficult to remember and recognize.
At present, there are two general programming languages: assembly language and high-level language.
The essence of assembly language is the same as that of machine language, which operates directly on the hardware, but the instructions use English abbreviations and identifiers, which are easier to identify and remember. It also requires programmers to write out each specific operation in the form of commands.
Each instruction of the assembler can only correspond to a very subtle action in the actual operation process, such as moving, self-increasing, etc. Therefore, the assembly source program is generally lengthy, complex and error-prone, and programming in assembly language requires more computer expertise, but the advantages of assembly language are obvious. The operations that assembly language can accomplish are not realized by ordinary high-level languages, and the executable files generated by source programs are not only small, but also very fast.
Advanced language is the choice of most programmers at present. Compared with assembly language, it not only synthesizes many related machine instructions into one instruction, but also removes details related to specific operations but not related to the completion of work, such as using stacks and registers, which greatly simplifies the instructions in the program. Because many details are omitted, programmers don't need much professional knowledge.
High-level language is mainly relative to assembly language. It does not refer to a specific language, but includes many programming languages, such as VB, VC, FoxPro, Delphi and so on. These languages have different grammars and command formats.
(1) Interpretation: The implementation method is similar to "simultaneous interpretation" in our daily life. It is inefficient to translate the source code of an application into the target code (machine language) and execute it at the same time, and it is impossible to generate an executable file that can be executed independently. An application cannot be separated from its interpreter, but this method is flexible and can dynamically adjust and modify the application.
(2) Compiling class: Compiling refers to "translating" the source code of an application into the target code (machine language) before its execution, so the target program can be executed independently from its language environment, which is more convenient and efficient to use. But once the application needs to be modified, it must first modify the source code, and then recompile to generate a new target file (*. To be executed. It is inconvenient to modify only the target file without modifying the source code. At present, most programming languages are compiled, such as Visual Basic, Visual C++, Visual Foxpro, Delphi and so on.
This question is actually very simple. As we said before, programs are the only way for people to communicate with computers, so if we want computers to serve us, we must have programs. Where do programs come from? Of course we wrote it. Maybe you will ask another question: Why should I program when I have all the programs I want? This is where you are wrong. Although there are many programs now, it won't take long to find a similar program directly on the internet, which may be what you need. However, it's like buying clothes. Although clothes are sold everywhere, which one is tailor-made for you!
Programs can also do many things. Different programs can do different things. The big aspect is the management of national finance, and the small aspect is the management of family accounts.
For another example, if you want your computer to play animation, you should also have a corresponding animation player in your computer. Below is an F 1ssh animation player. We will describe the programming process of this program in detail in later chapters.
With the rapid development of computers, people who can't program will be classified as "illiterate" one day. You don't want it, do you? Then learn a programming language well.
Will programming become obsolete?
Will programming become obsolete? Let me ask you a question first: Will computers disappear? The answer is the same. Knowing whether computers will disappear, you will know whether programming will be out of date.
Programming tools will be outdated, but programming will not be outdated.
The computer system consists of a visible hard inversion system and an invisible software system. In order to make the computer work normally, it is impossible to have only a hardware system. A computer without a soft drop system (that is, without a program) can be said to be just a pile of scrap metal, and nothing can be done. For example, if you write an article, you need to use the text editing software in the operating system to input the text, but without these text input software, have you ever thought about how to input the article into the computer? It's hard to imagine how to input text on a computer without any software (we call it bare metal). And these softwares are actually what we usually call programs.
Will programming become obsolete? Let's consider this problem from another angle. Will computers disappear? If one day everything in the world does not use computers, computers will soon disappear, and programming will not only be outdated, but also disappear. But will computers disappear? Of course not. Nowadays, computers are used in various fields and have made immeasurable contributions to human development. Imagine what the world would be like if computers all over the world suddenly disappeared one day. Maybe it will be as terrible as a power outage all over the world, and the loss will be even greater. The existence of computers must be maintained by software systems. Therefore, programming will never and cannot be out of date.
Today, computer programming language has developed from the most primitive machine language to today's visual integrated development environment, and even set up multiple languages on the same development platform, like Microsoft's NET platform. Looking back on the development history of programming languages, it is not difficult to see that for programming, only programming tools will be outdated, and programming itself will not be outdated.
Changing technology requires changing programmers.
Since the 1960s, computers have developed rapidly. It seems that no science in history has developed faster than computers, and hardware, software and network have all developed at an alarming rate. The development speed of computer hardware follows Moore's Law, doubling every 18 months (in fact, it has exceeded this speed now). The development speed of software is the same as that of hardware. In the 1990s, China's software industry was not very mature. Nowadays, large and small software companies abound, and * * * software can be seen everywhere on the Internet. The ever-changing technology requires ever-changing programmers. For example, Visual Basic can quickly build applications under Windows, and the technology of programming is constantly developing, and new concepts and methods are constantly introduced. For example, from the beginning of structured C, when the object-oriented idea was put forward, C++ appeared. On the basis of C++, Microsoft introduced Visual C++ to make it easier for users to build win32 applications. This also requires programmers to constantly update their skills.
Computer science is very different from other disciplines. Unlike linguistics and history, it is almost permanent. Computer science needs to constantly update its knowledge, otherwise it will soon be eliminated, even in programming.
Writing programs is interesting, because writing programs can do many advanced things. For example, in the following chapters, we will introduce how to write a Flash animation player with Visual Basic and how to write a download software manager. You can write more advanced programs than these if you like.
With the development of computer software industry, the position of "programmer" was born. Therefore, an idea is formed that the person who writes the program sequence is the programmer, so programming is the programmer's business. But programmers were not programmers from the beginning, but gradually became programmers from our current positions.
Writing programs is interesting, because writing programs can do many advanced things. For example, in the following chapters, we will introduce how to write a Flash animation player with Visual Basic and how to write a download software manager. You can write more advanced programs than these if you like.
Programming can also be used as a hobby or interest. If you are interested in it, it will be much easier to learn! Because if you are interested in programming, you will read more books about it and compile more small programs to practice on the computer, which is very helpful for learning programming, and with the continuous advancement of the learning process, you will find that it is not difficult, but easy.
In short, we must persevere in learning programming. As long as we have confidence and perseverance, we will learn it well. Don't shake your confidence because of some specious ideas.
Let's program together
How to operate the computer in front of us, I believe this problem is no longer the primary problem that bothers everyone. There are many kinds of software now. When choosing, did "computer enthusiasts" ever think that they could write their own software one day? Will friends who want to learn programming have a big headache when choosing a programming language because they don't know how to choose it? When I don't know how to start, will my friends say, "Can I program?" But any programmer can succeed without learning! In fact, programming is not as difficult and complicated as people think, and every friend who is committed to learning computers can try!
The necessity of choosing an appropriate programming language.
At present, there are many basic programming languages in common use, such as Pascal, C language, qBasic, Fortran, Visual Basic and so on. But the first few are all programming tools under DOS, and Visual Basic is a programming tool for application design under Windows. Now most computer users no longer use DOS, so we usually choose Visual Basic as a programming tool for beginners. Visual Basic is the easiest programming tool to use in Windows application design, and the learning steps are easily accepted by beginners. For beginners who are just beginning to learn programming, they still choose Visual Basic. Learning programming languages cannot be imagined as the best way, but step by step is the best way.
Strengthen your confidence in learning to write programs.
Writing programs is not the patent of people with professional knowledge. Everyone who studies computers can write programs. Everyone has different inspiration, ideas and practices when writing programs. But the same idea is to write a successful program. Learning programming is a long process, which requires hard work and sweat, but the joy of a successful person is beyond others' understanding. Overcome the difficulties in learning, practice hard, and have an idea: what others can do, you can do it yourself. The popularity of computers has given more people the opportunity to learn, and also let more people participate in the ranks of programmers. Everyone has the right to program, and opportunities are equal for everyone. Take out the confidence to win, be brave in making progress on the road of programming, and believe that success is just around the corner.
3. Can I program?
With the development of computer software industry, the position of "programmer" was born. So a concept is formed that the person who writes the program sequence is the programmer, so programming is the programmer's business. But programmers were not programmers from the beginning, but gradually became programmers from our current positions.
Writing programs is interesting, because writing programs can do many advanced things. For example, in the following chapters, we will introduce how to write a Flash animation player with Visual Basic and how to write a download software manager. You can write more advanced programs than these if you like.
Programming can also be used as a hobby or interest. If you are interested in it, it will be much easier to learn! Because if you are interested in programming, you will read more books about it and compile more small programs to practice on the computer, which is very helpful for learning programming, and with the continuous advancement of the learning process, you will find that it is not difficult, but easy.
In short, we must persevere in learning programming. As long as we have confidence and perseverance, we will learn it well. Don't shake your confidence because of some specious ideas.
Fourth, we program together.
How to operate the computer in front of us, I believe this problem is no longer the primary problem that bothers everyone. There are many kinds of software now. When choosing, did "computer enthusiasts" ever think that they could write their own software one day? Will friends who want to learn programming have a big headache when choosing a programming language because they don't know how to choose it? When I don't know how to start, will my friends say, "Can I program?" But any programmer can succeed without learning! In fact, programming is not as difficult and complicated as people think, and every friend who is committed to learning computers can try!
The necessity of choosing an appropriate programming language.
At present, there are many basic programming languages in common use, such as Pascal, C language, qBasic, Fortran, Visual Basic and so on. But the first few are all programming tools under DOS, and Visual Basic is a programming tool for application design under Windows. Now most computer users no longer use DOS, so we usually choose Visual Basic as a programming tool for beginners. Visual Basic is the easiest programming tool to use in Windows application design, and the learning steps are easily accepted by beginners. For beginners who are just beginning to learn programming, they still choose Visual Basic. Learning programming languages cannot be imagined as the best way, but step by step is the best way.
Strengthen your confidence in learning to write programs.
Writing programs is not the patent of people with professional knowledge. Everyone who studies computers can write programs. Everyone has different inspiration, ideas and practices when writing programs. But the same idea is to write a successful program. Learning programming is a long process, which requires hard work and sweat, but the joy of a successful person is beyond others' understanding. Overcome the difficulties in learning, practice hard, and have an idea: what others can do, you can do it yourself. The popularity of computers has given more people the opportunity to learn, and also let more people participate in the ranks of programmers. Everyone has the right to program, and opportunities are equal for everyone. Take out the confidence to win, be brave in making progress on the road of programming, and believe that success is just around the corner.
First, the development process of computer language
Up to now, there are thousands of programming languages published in the world, and there are 30 commonly used languages. In order to have 2 1 to choose and use them correctly, here is a brief introduction.
(1) assembly language:
It depends on the language of a specific computer, and the program written with it has high execution efficiency, but it is only used for some special requirements or special occasions.
(2) advanced language:
You may have heard of programming in high-level languages, but because you don't understand them, you always think these things are very abstruse. Actually, it's not. After learning the following chapters, I believe that students will produce programming.
But computers don't understand natural languages (which can be understood as high-level languages). How can programs designed in high-level languages be executed by computers? It's actually quite simple. I believe everyone will understand a lot after reading the picture below.
Now we will introduce you to several common high-level languages:
Fortran language is the main programming language used in scientific and engineering calculation. At present, most versions used in China are Fortran 66 and Fortran77. The main disadvantage of Fortran language is that it cannot directly support structured programming.
Cob0l language is widely used in business data processing. Because of its own structural characteristics, it can effectively support a variety of process technologies related to business processing. Its disadvantage is that it is not concise.
Algol language is the pioneer of all structured languages, with rich processes and data structures. However, this language has not been widely used, mainly due to its own historical reasons.
Basic language is a conversational language that explains execution. Because it is easy to learn, it is widely used in microcomputer systems.
PL/1language is a widely used language. It can support common scientific engineering and commercial applications, and can describe complex data structures, multitasking, complex input/output and table processing.
Pascal is a structured programming language developed in the early 1970s, with rich data structure types. Since it came out, it has been appreciated by everyone and widely supported by software developers. Pascal language has been used in science, engineering and system programming. Pascal language was designated as the programming language of computer specialty in the education conference of computer specialty of the Ministry of Education of China.
C language is the main language of UNIX operating system. Because of the success of UNIX operating system, C language has been widely used now. C language is designed by experienced software engineers. It is powerful and flexible. Like other structured languages, it can provide rich data types, widely used pointers and a rich set of operators for calculation and data processing.
C++ language is an extension of C language. 1980, Dr. Bjarne Strotstrup of Bell Laboratories and his colleagues began to improve and expand the C language, which was originally called "C with classes" and was named C++ in 1983. And constantly improve and develop, and become the current C++ language. On the one hand, it regards C as its subset, which makes it compatible with C. Many C language codes can be written in C++ language without modification, and many library functions and practical software written in C language can also be written in C++ language directly. On the other hand. C++ language supports object-oriented programming, which is its most important improvement on C language.