Why learn open source programmers can improve the programming skills?

First, read the code makes you better

The more programming in the early career of reading to understand the code, the code will be able to get better. When I had to maintain other people's code, simple and clean code is almost always better than the fancy or complex code - even if there is a comment. On the other hand, however, when I spend enough time to understand the complexity of the code, I used to be able to learn new skills. No matter how kind, make me improve.

This makes me fight again and again in those places no code review. And when there is not enough time to perform a formal "code review", I will browse your library and read the code.

Second, beyond grammar

When you have to wrestle with the syntax of any programming language, that is, to learn how to make full use of the language most trivial moments. The syntax of a language tend to be very static, and if you are wrong, your compiler will accuse you. The course covers a deeper level what language best suited to solve any kind of problems ( "the right tools to do the right job"), and how to write code in that language in order to make it efficient and maintainable.

There are many ways to learn a new language: courses, tutorials, tutors, books and so on. I usually combine these options to learn a new language. When it comes to non-syntax elements, these methods are often very similar.

Read other people's code is actually deployed will make you gain more. Not just conventional structured learning, you also need to learn patterns and practices. Language in the so-called "right" way of doing things is not always the best way to effect. You will experience edge cases, unexpected one-time transaction and integration. You will find solutions to these issues, both good and bad, but if you seriously think about it, then this is the place to come out, "recommended practices".

Third, open source is everywhere

With the development of the open source movement, the number of codes available for reading and learning has greatly increased. For example Gitlab, GitHub and to BitBucket these sites allows us to get full-featured applications, not only can read the code, you can also play with. There are very few things I want to learn can not be acquired in the open source code.

I had to learn a new programming language, will focus on issues such as directory structure and naming conventions on these simple things. But now, I will find a number of different open source projects, then we can begin to piece together commonly used method. I rarely emphasize before those types of things.

The code is available so much, but the quality is good and bad. When we want to learn, and often do not know better or not. Then keep reading bar codes, and slowly you will learn how to distinguish. Read the "bad" code can help you understand why it is "bad". The key is to not be afraid to try anything you think looks right thing, and when you go the wrong way when able to admit mistakes and correct the problem, and then move on.

Fourth, the bad code is bad, is that right?

Some would say "bad code to be more and more obvious than good code."

When I see the code I used to write, my first thought was how I would write such garbage code. This effectively means that I'm still learning. If I see my old code, I think it looks very good, so that I did not improve.

So, how can we learn from the bad code things?

Fifth, the more you read the bad code, then you are more adept at detecting bad code

When you study and search examples, you will find and use a lot of code does not work. Remember, just because it does not fit your situation, it does not mean it is bad code. Learn how to make it work so that you can become better.

Sixth, how do you know it is bad code?

People like to criticize. Read the reviews, if you see a lot of "WTF (What the hell)," then you might see is the bad code, trying to figure out why bad reasons. Do not leave only "This code is really bad," such comments. Do not pretend like you know all the needs of bad code, you know, there is always a justified reason it is written like this. If you know the reason why it is bad code, you may wish to leave a constructive comment.

Seven, it becomes a good code

Place to make a pull request code becomes better. Correcting grammar, using better methods, add comments or modify indents: These are great ways to improve the code. Why do you add a recommendation to change the interpretation of the code.

I found that when I help others learn when to learn more. If I think I understand a new topic, so I'll try to find someone to explain to him, it makes me more deeply understand and remember it, and I quickly found that if I write bad code.

Eight return

Remember that open source when you get involved in the best results. Code changes are welcome in most projects, but there are many ways to contribute.

Test open source code and file bug reports; help complete set of documents; writing tutorials and examples of how to do; to participate in the dialogue - or just to help spread. Everything can bring change, and the more people involved the better!

Guess you like

Origin blog.51cto.com/14512197/2446248