C ++ starts from scratch (1) - What is programmed?

xiaoxiao2021-03-06  58

C starts from scratch (1) - What is programming introduction I have asked me that I have some found questions, but these people can use the VC to edit a dialog interface to make the necessary operation or documentation / Vision interface to receive port data in real time and dynamically display the curve (also using multi-thread technology), but even those foundations are unclear, and the most serious consequences are caused by poor code (although it is multithreaded, but I don't dare to compliment), I don't know the meaning of the class, mixing various techniques for use to achieve the goal (all the use of abnormal replacement statements), the code logic is confusing, and it feels like Jinshan Express translation. I think anything is the most important, and I will no longer be a programming work after I finished my custom project, and I have no significance of these experiences. I will tell me in this series. For programming, helping people interested in computer programming quickly (but maybe not imagined so fast). Since I never read a book of C books (all of the zero clustered occasional flooded), and this series is not a dogmatist and explains the names and their explanations, but hopes that readers can understand programming. Instead, I am learning a language (ie, I will not only turn over the Han, and I will also turn over the English). The entire series is written in all my own understanding, and there is no reference to other textbooks (in some foundations or refer to MSDN), the content in this series may have inconsistent with the classic textbook, but their essence should still The same, just the angle. This series does not carefully explain each keyword of C (some is not important), after all, the purpose is not a C language reference, but the programming. If there is not mentioned in this series, please refer to the C language reference in MSDN (you should have the ability to do this after reading this series), and the content given in this series is compiled with VC. Based on the 32-bit Windows operating system. The title and main content of each article are listed below, and the title of the red modified article indicates the focus I think.

C from zero (1) - What is programming (explaining the real meaning of programming and two important but easily ignored basic concepts) C from zero (2) - what is the expression (indicating the use of each operator, but Not all, the remaining will mention other articles) C from zero (3) - What is called variable (describing the computer's working mode, elaborating the most important concept of memory, address) C from scratch (4) - assignment Operators ("C " continues from scratch (2) ", and is a bit based on the explanation of the pointer. 6) - What is statement (explaining the various statements provided by C , indicating the reason) C starts from zero (7) - what is the function (description function and its existence) C from zero (eight) - C Sample 1 (give one or two simple algorithms, step by step) How to write C code from the algorithm) C from zero (nine) - what is the structure (brief description, enumeration, etc.) C from Scott (10) - What is class (explanation, definition, header file, etc.) C from scratch (11) - class related knowledge (explanation, inheritance, name space , Operator overload, etc.) C from scratch (12) - what is object-oriented programming idea (explain what is described as programming, focusing on object-oriented programming ideas) C starts from scratch (13) - C sample 2 (explanation how Design C program based on object-oriented programming ideas) C starts from zero (fourteen) - what is template (explaining template technology and its existence) C from zero (fifteen) - what is abnormal (explained abnormal technology Reasons for existence) C starts from zero (sixteen) - what is precompiled instructions (indicating the concept of pre-compiling instructions and several commonly used instructions) C from scratch (sevente) - C some of the legendary keywords (Explicit, Mutable, Volatile, etc.) C from scratch (18) - What is SDK (indicating why no music instructions can still be able to make music) C from scratch (19) - What is the C of the C (twenty) - a little basic knowledge of the VC (twenty) - a little basic knowledge of VC (

Note Several basic concepts of VC and some common settings) C from scratch (21) - C sample three (using VC to write a simple program to implement polymorphism through DLL) What is the program program, ie the order of the process , It is accurately that multiple processes arranged in order, which are described. For example, eat vegetables, first pick vegetables with chopsticks, then send vegetables into the mouth with chopsticks, and then chew and swallow. The clips, send, chew and swallow are called commands, while the dishes are resources, such as shapes, locations, etc.) as the command is executed. The above is a description of the method of eating a dish, which is the process of eating vegetables. Any method exists to change the state of certain resources, so any method is described, that is, the program, and there must be a command of this thing and the resources they have. The command is implemented by the executor of the program, such as the vegetables above, the clips, delivery, etc. are implemented by those who eat vegetables, and the resources must be what the executor can change, but the order is just telling How do executers change. The computer program is the same as above, which is a description of the method, and these methods are what people can do (notice that the computer is going to do. This often has been confused by many people). When people need to do these things, people need to do things Give some resources to make the computer to do correct changes. If the program is calculated, it is only the description of the method, it is not any utility until it is executed, and the human given it a piece of memory (for memory, please refer to "C from zero (3)"), tell it After the accuracy of the calculation results and the storage position of the calculation result, it changes the status of the person a given memory to exhibit calculation results. Therefore, for the computer program, the command is the directive of the CPU, and the executor must be the CPU because it is an instruction of the CPU, and the last resource is that the CPU can change its state's memory (of course, such as port, etc., but The general application uses a large number of inner stages). Therefore, the computer program is a description of how the computer changes a given resource (generally memory, or other hardware resources), note that it is not any meaning, unless it is executed. What is programming program is a writing program, that is, the development method. Why have you had a way? The method is to illustrate. There is a lot of reasons why there must be, but the root cause of computer programming is because the language is different, but not only different, even the concept is not connected. The human language is five flowers, but it can be positivelighted by translation, because human beings are survive in the same four-dimensional physical space, with the same or similar perception. The space and physical space that the CPU that the computer program is executed is serious, so it is impossible to translate computer programs into a description of human language. This is important, which has led to the poor code written by most programmers, because people think that there is no commonality they want, so they randomly watched it when writing programs, which in turn leads to poor but can be implemented. Code. The computer's language is the CPU instruction, because the CPU has this perceptual approach (accurately said that there is memory location, interrupt response, etc.), unlike human beings can have physical languages, the computer program is a method of writing human language Translated into a corresponding computer language is a translation process. This is completely different from the general translation, because the previous red word, it is impossible to translate.

Since it is impossible to translate, is the computer programmed? Consider a carpenter, I am a guest. I said to the carpenter, I want a rocking chair, lying very comfortable. Then the carpenter began planing the wood, and made a rocking chair under a special curve to ensure that when I shaken, the focus was always unchanged. Here I have compiled a simple program, only one instruction - make a very comfortable rocking chair. The carpenter translated my program into a planing wood, design a series of procedures I can't understand. This is the case, here is because the space and woodworking of my life (the woodworking process, not a carpenter) has no commonality. The carpenter is equivalent to the computer programmer and CPU (because the carpenter's craft is the CPU's command definition, while the carpenter translated my procedures into some procedures for woodworking, by the carpenter through its craft To implement these procedures, that is, execute procedures. Due to the space and woodworking of my life (referring to the woodworking process, not workers), it is impossible to translate, but the above translation is successful, it is actually not translated. In the eyes of the woodwork, the rocking chair is just some straightforward and curved stitching. If I treat the pile of wood as a weapon, it is a weapon, not a rocking chair. "Nonsense concession plus fart!", Maybe you will call it, but computer programming is such a thing. The CPU can only sense the instructions and changes in memory (do not consider other hardware resources and responses), if we write a program calculating the percentage, a single memory is given, execute, and after the completion, see the computer screen display correctly result. However, it must be noted that the computer actually copies, adds a number of memory, adds, and multiplied, and the computer does not know that is the percentage, and if the executive person does not say it is the circumference, then the result is not a circular rate. Maybe a random number or anything else is just that the luck is very good and the circumference rate is amazing. The above things I will be called semantics, namely the meaning of language, but it is not only applicable to computer programming, but also many technologies, such as machinery, electronics, mathematics, etc. have their own language, and those designers are responsible for The customer's simple program is translated into a procedure described in the corresponding language. As a programmer, it is extremely necessary to understand the importance of semantics (I am in my other article "Semantic needs", in the case of the code-level semantics, interested in referring to it), In a subsequent article, I will also mention semantics and their impact on programming. If you have not understood what it means, with the reading of subsequent articles, it should be more and more clear. Computer programming basics - compilers and connectors I have never seen (but there should be) any C textbook has a compiler (Linker) (Linker) (in very old C textbook) I have seen it in the middle of the programming environment like VC, and these packages are hidden. Here, it is very important to understand their understanding. This series will be used in large numbers of vocabulary, which determines whether it is very important to understand, definition, external variables, header files. The computer programming is a "translation" process. To translate the user's program into a CPU directive, it is the machine code. The so-called machine code is a program written by the CPU instruction, called a low-level language. The programmer's job is to write out the machine code.

转载请注明原文地址:https://www.9cbs.com/read-115426.html

New Post(0)