twitter

Good brothers, this is the end of the Redis series. Although not to read the source code so deep, but a lot of knowledge is basically the principle of the way to draw the clear (the source code is also mainly do not understand ah, some basic grammar forget light). Spring is the next direction, as long as the framework is truly ubiquitous. In addition, this topic series will involve source code related content, it is recommended that good brothers get a set of environment and then read the article while debug. This is the biggest help to good brothers, because the source code just read other people’s articles or video is really useless, because I tried.

I believe there are a lot of good brother are more or less read some source code, but I heard the most is what, see no what use ah, just began to see a few days have forgotten. Yes, it’s a process, and once you get through it, your coding or comprehension skills will go up a notch. Of course, there are a lot of good brother will say, I have not read the source code, there is no way to efficiently learn the source code. The answer is yes, there are many ways to read the source code efficiently, but it is very important not to read the source code and to see the source code, because this way is not to find the power, will be like a headless fly in the source code everywhere, simply can not be clear.

In addition, reading the source code requires persistence. Do not encounter some difficult or do not understand the place to give up. Of course, there are many good brothers just for the interview, feel that there is no need to read the source code. But is it true? Interviews these days are all about principles, likeHashMapThe principle of. This you don’t read the source code to read other people’s blog is able to cope with some interview questions, but ask in a deeper point is not going to be asked, the final result is like me waiting for nearly four years have not given me a notice (manual dog head).

advice

I will not go into details here, but I will talk about some specific ways to target some Spring function points. I will only talk about ideas.

  1. Make sure you know what the framework is, what it does, and why you read the source code before you read it. This is really important. Anjiang’s first pure idea was to read the Spring source code and write it on her resume. Finally did not stick to a few days can not continue to watch, and then during the interview installed several waves of results were pressed to the ground friction.

  2. Be sure to find the entry before reading the source code. This is also very important, because there is no entrance is really do not know where to start, like the above said like a headless fly, finally broken and bleeding, nothing.

  3. Be sure to try. Don’t be a keyboard warrior. This is also said above, a lot of good brother consciousness impulse to see the idea of source code, but this process is really boring, you do not start will only be led by the article or video, you are unable to find their own problems. It turns out these questions are good for bragging. That’s why you write code, and that’s why you interview people.

  4. Hold on, hold on, hold on. Persistence is victory, there are also a lot of good brothers will have a lot of excuses to relax down, and finally indulge themselves. On the one hand, I want to improve and on the other hand, I want to be comfortable. This is not going to work, as long as you stick through this phase, reading the source code may become your hobby.

  5. Choose an appropriate framework to read the source code. This is also very important, Anjiang has a lot of good brothers around to read Srping source code. This is really difficult, thousands of classes ah, good brothers, not dizzy to strange. In fact, there is always a misconception that reading source code must look at these well-known frameworks, which is not the case. In fact, the code is written, written, written by people. I think good brothers have seen colleagues of the code, find a code you think is the big guy to see, this is also to read the source code. If you think you are awesome in the team, take a look at methods such as get and set in HashMap. In fact, there is not much code, but some algorithms will be designed. What is the main view?

  6. Be sure to annotate. This is also important, because you can’t do anything of the Spring magnitude without doing it, and if you go around a few times you forget what this is. Of course, you can also use others to write, and then read their own understanding to add. This also has the advantage of being able to record your own problems, such as adding a TODO to a comment to record the problem.

  7. Make proper use of third-party tools. This word to good brothers look at the source will be used, such as I want to see a class of inheritance, the main method of the class and so on. Ideas, Eclipse and others have good support for this.

conclusion

In fact, the above are some anjiang look at the source code experience, we all know, who will speak truth, the key lies in practice. I believe there are a lot of good brother are eager to try, or before also want to read the source code, as now rushed.

That’s it for this issue. Please leave your comments in the comments sectionAsk for attention, ask for likes