The law of developer survival--How to make yourself more professional as soon as possible

Source: Internet
Author: User
1, master the methods and skills of reading code
No matter what you want to be in the end, just come into the profession, must be inseparable from the reading code and writing code. Here are some ways and tricks to read the code.

Read the code of this matter, first to be divided into intensive reading or extensive reading. From the point of view of learning, must be intensive reading a quantitative classic code. and intensive reading means that each line is read, without looking at the code in the brain can outline the basic structure of the program. To judge whether the intensive reading has a very image of the way to judge: Intensive reading code will be full of code, can not put down, even before sleep in the brain is also code. To achieve this level is intensive reading, otherwise it should not be. Intensive reading code to control the size (the initial phase of 10,000 lines can be) and attentively, do not need any special methods. The main concern in this section is how to extensive reading large scale code, not intensive reading. Many of the existing systems tend to be large, and hundreds of thousands of of lines may be just plain. Once you've joined a project like this, how do you read the code? Before you read the larger program, you have to get a general idea of the specifications, but you can't go to school. For example: For an application, you should make a general understanding of how it is used, how to use it, and the definition of its external interface for the library. If it involves some specific areas of knowledge, such as: process, accounting, etc., it is better to have some knowledge beforehand. It is unlikely that such things will be pushed back completely from the code. If you do not know this kind of things, many times to read the program is a big obstacle. You do not know what the code is doing, but to read the corresponding program, it can only see the call to go, eventually will be foggy.

Next from the big to small, from the point of view, once you start to contact the code, you need to first understand the basic static structure of the code. such as: package composition, class composition and so on. There is almost certainly a level of concern here. All of a sudden put the level of too deep, it is easy to stare at the details can not come out. Pull the layers too high and easily flow to the surface. In terms of number, it's best not to have more than 10 key concepts at one level, more than I really remember. In the static structure this step, to understand each part of the core responsibilities, can be a very simple generalization, it is best to remember. Next, select the most commonly used typical scenarios and then examine how the above static structure works in a typical scenario. The interfaces used in a typical scenario are often key interfaces, and their definition and role should be clarified. Also need to clear the typical scene data flow changes. These two steps are equivalent to a high-level static and dynamic structure diagram in the brain, much like the sequence diagram and class diagram in UML. When it comes to the database, it is generally necessary to understand the corresponding data specifications. The next step is to focus on the process, the structure of the thread. For example: When the beginning, when the end, in the above typical scenes are responsible for what. After the completion of the four steps (specification, static structure, typical scene, process thread), the first extensive reading of the program is completed. Testing whether to achieve the goal of the method can be very simple, if you really understand the basic, then should be able to rely on paper and pen to describe the typical scene of the sequence diagram.

When you do your first reading, suppress your thirst for knowledge, because you always want to callstack the implementation details of a function in the debugger. At least in the first reading, you can not do this first. After the first extensive reading, it is necessary to enter the process of deep excavation, generally speaking, to the part of their own will be responsible for in-depth excavation. This part of the function is often hidden under an interface.
At this time, generally speaking, functional modules can be reduced priority, such as: XML parsing module. Other parts can be thought of as needing to repeat the four steps mentioned earlier. But it's time to focus on details and call stacks.

Regardless of the level of the read code, there are two basic skills are always needed, one is to master the specific procedures embedded in the log mechanism, to be able to see the log, if necessary, may also add log; one is the basic debugging method. At the same time, a suitable code reading tool will help improve the speed of code reading, such as: a small tool called sourceinsight can split the window into several parts, click on any method, the implementation of this method and Callsgraph can be automatically expanded, Such a small feature is undoubtedly helpful for reading code.

2, from which programming language to learn better?

Learning to program at least one programming language, but starting from that programming language is an extremely contentious issue. To make the conclusion stand up to scrutiny, there is a need for systematic analysis.

Pure from the perspective of future applications, the results are uncertain, in the study, in fact, no one can know the future will mainly use the language. Because the programming language used in the final work often depends on some very accidental factors, such as the language of the existing product development, the area of the problem to be solved. For example, if fate arranges you to do a work related to Hadoop, it is likely to be used in Java, and if you are assigned to drive development, it is likely to be used by C + +.

If this point is set up and presupposed, then there can be a relatively definite answer to what to learn at the Learning stage: The purpose of learning a language at the learning stage is to master the basic concepts of programming and to learn another language more quickly. It is clear that this is still the foundation of the groundwork.

From this point of view, there is only one language that must be learned, and that is C. Because not knowing this language will cause a certain degree of vision limitations, make the foundation weak, for example, the person who does not master C language, probably cannot understand "the deep understanding computer system" Such book, further also does not understand what is the pointer, what stack, what is stackoverflow, what is writes the super boundary, You may not be able to think of some system-level tools when doing performance optimization. Joel has a special chapter in the software random book called "The Dangers of teaching Java in schools", and the views expressed here are similar. As a result, although probably not in the work of C language, in the study of the time to master it, unless at the beginning of the decision to only use technology as a stepping stone, and do not want to go farther. Otherwise the foundation is too weak.

As for other, more mainstream languages such as c++,java,c# can be chosen entirely according to interest, the only key is to accumulate a certain amount of code regardless of the selection and learn it. This expands to the future programming language, the learning curve will often be very flat, roughly 2-3 weeks can do some basic development work in the new language.

Another way to choose a programming language is to start with scripting languages, such as Php,python,javascript. This and kuangyin in the year to make decisions is the first to deal with weak southern Tang or the first to handle strong Liao state, is a dilemma. From the point of view of easy to start, the development of interest, obviously the script is better, and scripting language is the Internet, the opportunity to use is very high, but if you want to accumulate, thick thin hair then it will be better to start from C. My personal advice is that if you're in college, it's easier, because you don't always have that big chunk of time in your life, but if you want to go into the industry, then just start with the script.

3. Summary

The fundamental purpose of writing programs, reading programs, learning to learn the steep curve, and avoiding the IDE's reliance on these things is to lay a good foundation. This link is the most taboo is quick success, such as: Learn a bunch of IDE's operation method, each programming language has a little. Many people may mistakenly think that this is helpful in finding a job, so it is common practice to include any technology that has been contacted in a resume. But this is not the right thing to do, when a small company hires a graduate or a developer who has just graduated and is more focused on his foundation and development potential. The basics and potentials are hard to measure, but they are not difficult to judge and can be judged by simple interviews. The company that focuses on what the person is capable of is likely to be the company that won't see tomorrow.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.