Do you want to read source code for development? If you are 996 every day, I really don’t recommend you to read the source code (I don’t mind being a dissuader). Reading source code is indeed a time-consuming and laborious job, and if you are busy every day and occasionally look at it to understand the mystery, it is difficult to do. Do we need to read the source code? Read the source code can bring us, this article will explain one by one, after reading, you want to consider whether to read!

Writing in the front

Before considering how to read it, let’s take a look at what others think about reading source code.

  • Q: Is it useful to read source code? A lot of things are out of the box now, since there are wheels, do I need to read the source code again to create a wheel?

Answer: Useful! If you read the source code for a few minutes every day, it will only cause you pain, and there is really no point in reading it without continuous, productive reading. If you are not familiar with the basic application of the framework, it is not recommended that you read it, just adding boring knowledge to your knowledge (even if there is a lot of logic in it that you don’t need, it is really just training your mind). Of course, there are too many useless reasons, but if you are always using, read source code, at least the function is your design ability and the ability to optimize the code, which is more to enhance your soft coding ability. If you want to say a little intuitive, the source code is written very good, into many optimization, you can see more to learn these excellent coding methods. The second is that if there are a lot of frame holes, you will have a good idea of where the problem is coming from. In the end, which may not be so obvious, when you’re going to do something, you’re going to improve your design ideas a lot

  • Q: can I read the source code if MY English is not good?

Answer: Yes! English is not good and can not hinder the reading of the source code, after all, there are many translation software, the translation may be some differences, but with the code is also about nine out of ten. After all, there is a certain background, is able to effectively correct some possible mistakes.

  • Q: Who needs to read the source code?

A: This question is like whether I need to read a book. The normal way is that I should persuade you to be positive. But let’s be practical. There are many ways to improve your ability, and not everyone needs to go from zero to one. Like you have a good system of knowledge, or you have a great teacher. You’ve been sorted out so you don’t have to start from scratch. Then there’s no need to go far. If you are engaged in architecture work, if you want to solve some bugs related to the framework, you have some problems in your application, this is an urgent need to learn. In you do not have a good resource support, and you want to have a good promotion, this kind of people can also read, after all, the source is a good teacher.

Why read the source code?

After reading these questions and answers, do you have some answers? So to sum up

  • Improve design ability and problem solving ability
  • A way to increase your salary
  • Improve coding ability
  • Gives you the ability to use the wheel and create the wheel
  • Better grasp of the framework

How to read the source code?

  • First you need a source code

Some people just want to be lazy, or use the fragmented time to directly break dependencies in the project. This is a very wrong approach, and you really only waste time. (download the source code, the installation will be dedicated to the article)

  • Reading after breakpoints is not recommended

Is following breakpoints step by step really good for your code? That’s really not how you look at the code. There are a lot of friends in the first read source, like to follow the breakpoint step to read. This is not recommended. Actually, how many lines of source code are there? How many ways? For a function point, go step by step through the breakpoint and examine the code. What do we get out of this? It just gets more and more confusing. So many methods, so much code. By the time you follow these five tips, you’re almost done.

  • Learn to do figure

Might as well do some brain maps, to assist their own good to read the source code. Drawing is a senior required course, do some graphs at least not so easy to dizzy. If you read the source code in a methodical way, brain maps can be a great help in parsing the flow.

  • Read in question

There’s a premise to this one. Our biggest problem is not that we need to ask questions, but that you can’t ask questions or ask effective questions without knowing something. So with questions to read must first look at the framework of the basic process and function, from the process and function to start with a lot of efficiency.

  • To become familiar with the framework and its function points

This can be used in conjunction with the previous point. As you use it, think about why you’re using it this way and ask, in turn, why the author is designing the rules so that users can use them this way. We can also reflect on the point from which the author designs this function and why he chooses this way to achieve it.

  • Pseudo code to implement their own ideas

Just looking at it is really looking at it in the end. It may have developed reading skills, but it didn’t really break through much. You can consider following your own understanding after reading it. At this time you can reverse your understanding is right. If you write out at least to prove that understanding what problem, but also can do one thing, that is to be able to compare their own implementation and source code, in the end is you write good or he wrote good, good where, learning his excellent way to achieve.

  • Knowledge knowledge review

After learning a part, we are going to review, of course, this review is not to say to review, but that we learned this part of the function of the understanding of the source, in the actual application to find the corresponding function, and then to see what can give us help.

I recommend following some books

  • Deep Parsing of Spring source code
  • Spring Revealed
  • Inside SPRING Technology

One last question: How to persist?

Give up reading source code reasons, basic on these several

  • laborious
  • Too complicated
  • Don’t have the time
  • No obvious results
  • Confused about some features

It is very normal to give up, and it is not reliable to raise your salary as a motive force. It is just to exercise your skills, see the knowledge points and read systematically.