"Programmer", mention this name, let our mind flashed a long string name: one hand to create a modern software dinosaur - Microsoft's Bill Gates; Chinese national software industry representative Jinshan Company's headman - seeking Bojun; Microsoft's nightmare, the representative of free software, the father of Linux, Finland, Linus Torvalds ... These names in the IT industry are all from one programmer started from one programmer. With their The software is increasingly popular. Their names are also gradually respected and respect. Many young people also have a programmer with them, dreaming as a programmer, and finally become a new generation of IT hero. Here, the author from a professional programmer Angle, I want to talk to you my feelings. Why do you want a programmer? It seems that this problem will seem too simple, too naive. Look at the comfortable working environment of the programmer, rich salary, too " Happy "white-collar life, everything seems to be self-definpected. In fact, this is only seen by the programmer. The other side is not concerned about the public: no day, no night, the overtime is home to the meal; all day and keyboard deal, Change your code to change the tens or even hundreds of times, the purpose is to try to grab a small bug ... How many people can be handled in this boring life? There is no persistence of the software career itself, The source code is almost fascinating, all of which is ordinary people can't endure. But when your procedure passed the test, becomes a qualified product. At this time, it is so strong that it is so strong in your chest, also Only those who really love programming will feel true happiness. So if someone asks you to be a programmer, then tell him: I have enough courage to face every debugger, there is a firm will and confidence Write every line of code. This is my love, programming is a pleasure! There is a rule, the development of Chengfang process is a very flexible work. For example: the variable I increases 1, in the C language, I , i, i = 1, i = i 1 and so on. However, this does not mean that the programming can be as desirable, the sky is traveling. Good program habits can improve work efficiency, reduce unnecessary mistakes. Especially for beginners. It is important to pay attention to:
First point: When programming, first create a good data structure. When the program is programmed, if you start the data structure design error, then you have to spend a big cost to modify the program. I have had such a painful lesson: a program has written more than 2500 lines, and suddenly found that the basic data structure is unreasonable, and the result is overwritten. "Don't cut the knife," it is definitely not the old man. Before starting writing code, doing the research and preparation of data structures can often achieve a half-time effect.
Second point: The code is used to reuse and modularize. Whether it is oriented or object-oriented, code reuse is one of the basic principles. For example: If you want to draw a green apple and a red apple, write a function to draw an apple, pass the color as a parameter into it. This can draw apples from different colors as long as they call the same function. The benefits of doing this are that the procedures are easier to understand, and the modifications are also convenient, as long as you modify one place, you can change the two apples. This is also impossible to develop some short programs, but when developing large programs in the future, the efficiency of work is significantly improved. This is a smart person to make a clever thing, gain the biggest gain with the smallest cost.
Third point: Good writing style. A program, it is impossible to be absolutely perfect, and it will never be modified. Since you want to modify, you will inevitably reread and understand the original code. The good programming style can make people more convenient and quickly understand the structure of the program, so that the modified efficiency can be maximized. Here, the author raised some kind of programming style requirements: 1. Unified naming naming specification: A variable Ncount is obvious than the III more easily understood to understand its true logic meaning and data type. Therefore, there are many letters in the variable and function name, so it makes sense, and it will be more convenient in the future. 2. Code layer-by-layer indentation format. This has almost become a standard, which makes the level relationship between the code is very obvious, and it is very helpful for the logical understanding of the program. 3. There is a rule of code location. Conveyed the code of the relevant function, put together, so when you read the code later, you can avoid frequent switching between different file modules. Since the logic inside the function should not be writable, the logic inside the function is very complicated. For example, the circulation nested is suitable in three layers, and the number of code lines should be left and right, too long, is not conducive to understanding. If the loop is really too much, the code should be too long, you should consider re-dividing a finer subunies. A good programming style is certainly more than these, which also needs to experience in the process of learning. Quaternary: Pay attention to the program test, pay attention to abnormal processing. This is often a significant difference between amateur program enthusiasts and professional programmers. Amateur program enthusiasts often only focus on the procedure to run normally, and the occupational programmer must pay attention to the procedure to operate in the abnormal situation, at least normal termination. And this is based on the full understanding and testing of the procedure. Use different situations to test your own procedures, you can discover more hidden bugs, thereby improving the quality of your program.
A thousand miles begins with a single step. Making programmers have more twists and turns and difficulties. But as long as you love the software development, you will pay for it, and finally will make you feel happy. Come, I still hesitate, embarrassed to this programmer, go forward!
What is the learning programming? For the majority of programming beginners, there is such a universal understanding: the learning program design is very important. The opening closure is Visual Basic, Visual C , Delphi, Power Builder, and more some popular development tools. I often see that there are beginners asking: I learn C / C , is it good to learn Visual C , or learn Borland C Builder? Alternatively, it is required to make a choice between Visual Basic and Delphi. What is the relationship between learning program design and learning programming language? How should beginners should pay? Thus, we have a simple alteration: learning program design is like learning shooting, and the programming language corresponds to air guns, pistols, rifles such as guns, pistols, rifles, etc. Learning shooting must choose a firearm, it is impossible to do not have a gun, and it is impossible to learn all the firearms at the same time. However, if you master a firearm, you will be able to touch the category. Because in familiar with a firearm, it also learned the shooting technology itself. Learn other, natural things are half-time. Learning programming is also the same, inevitably start from learning a programming language. At the same time, in the process of learning, not only to master this language syntax itself, but also learn the idea of programming, this is the basis for all programming languages. The programming language is "one law pass, all laws". Suggestion: The learning programming does not have to be demanding must be in a language, and you can choose a relatively easy acceptance in the middle of Visual Basic, Delphi, Borland C Builder or DOS. . It is mainly learning the idea of programming itself, and learning is to look at the problem with the vision of the program. Perhaps, the effect of learning cannot be seen right away, but you can learn solid basic skills, which is great for future development. These basic successes include: 1. What is the purpose of strengthening logic analysis and creation of mathematical models? It is to solve the problem in reality. The problem in reality is to use natural language, the current computer cannot understand. What we have to do is to "tell" computers in the way you can understand. It is also necessary to logic analysis of real issues, establish a suitable mathematical model, and then enter a computer in the form of programs and data, allowing computers to help us analyze resolution. A simple example is the processing of the computer for colors: each represents a color with R, G, and B three-color components, and the processing of colors is converted to the three integers of R, G, and B. As long as we change these three integers, we can change it into another color. For other realities, we must also make it "understand" by the computer. This is the first step to be solved by programming, otherwise it will be available at all. This is based on "experience", which is to gradually accumulate in the process of learning.
Second, the data structure and algorithm knowledge program development has developed to the present, and there is already a more common, complete mathematical model (we call data structure) and the processing method corresponding to these mathematical models (that is, algorithm). The current program is based on this. The experience is circulated in the middle of the programmer: "Good data structure is half of the program." It is important to see. As a programmer, if you don't know the stack, queue, linked list, tree, you don't know the search, sorting, tree traversal in the algorithm, which is not imaginable. What we say "Programming" is also specifically manifested. Therefore, the data structure and algorithm knowledge is the focus of the learning programming process, so that you can feel your hand during the development process of future procedures.
Third, the rich practical experience program is itself a very practical discipline. A program that exists on paper is like a bird without wings, never fly in real sky. Ren, the code is written, and the style is beautiful, it is just a series of characters on a piece of paper. It is like a composition practice, maybe it is very good, but don't give it to the teacher to visit, what is the difference between white #? Here, the program is a composition, and the computer is a teacher. Only the "essay" is handed over to "teacher", and the debugger can confirm whether the idea is correct, or what defects are seen. Of course, there is still a lot to communicate with peers, especially with the popularity of the Internet, we can also see the examples and source procedures prepared by others, as a modern programmer, this is also a good opportunity to be missed. Finally, as a programmer, there is a little requirement: that is, the physical quality is good, you can stay up late.