Quickly master the most commonly used 50% of a language

Today's development work requires us to be able to master a language quickly. Generally speaking, there are two attitudes to deal with this kind of challenge: one is to take a rough look at the grammar, roll up your sleeves and start working, and study while checking Google; the other is to spend a lot of time learning the whole language completely, Have a good idea, and then start doing the actual work. However, both methods have drawbacks. The problem with the second method is of course obvious, not only is it wasted time, it deviates from the goal, but also the learning efficiency is not high. Because language learning that is not driven by practical problems is usually weak and in-depth. Some people learn to become language experts, but forget that they are here to solve problems. There are also problems with the first way. If you don’t know the temperament of this language, you will piece together the code boldly, and the things you write will definitely not be in the flow. Talking about wearing new shoes and going the old way, and putting old wine in new bottles, those are all minor problems. What's really serious is that such programmers can accumulate a lot of buggy code in a short period of time. Due to the limited degree of testing in the development stage, these junk codes can often pass through this stage, thus lurking, becoming a cancer of the entire project in the later stage, and repeatedly causing the later maintainers to fall into the Sisyphus predicament.

In fact, language learning has certain rules to follow. For developers who have mastered a language, they can master 50% of the most commonly used languages ​​within a few days to a week at the fastest speed. And to ensure that the road is basically authentic, there is no ills. In fact, I am not afraid of not being able to write programs at all, but I am most afraid of accumulating solutions with little knowledge. Because you don't know it at all, you will naturally go to the book to study carefully. If you have good learning ability, the quality of the code you write will not be bad. And if you don't know much about it, if you make steel by yourself, what you get out is basically scrap copper and rotten iron. For example, error handling and serialization, many people do not understand the "right way", but rely on their own half-knowledge to create wild ways, which is the most dangerous. Therefore, even if time is tight, these contents must be fully understood first. After mastering these contents and entering into actual development, even if there is a problem, it will basically not hurt the overall project. The developer himself can be a car, and slowly improve himself in practice.

The following lists a learning outline, mainly for experienced people, not suitable for beginners. This outline can only be used for general vulgar programming language learning. Currently, the top 20 popular programming languages ​​are basically vulgar languages. If you want to learn a non-vulgar language like LISP, or a secondary development language in a software, the advice here may not be appropriate. Again, just for reference.

 

1. First of all, understand the basic data types, basic syntax and main language structures of the language, the use of main mathematical operators and print functions, to the level of being able to write after-school math problems in Tan Haoqiang's programming book;

2. Secondly, master the use of arrays and other collection classes. If you have the basics, you can understand generics. If you can't understand it, it's not a big problem. You can make up later;

3. Simple string processing. The so-called simple is the content below Regex and Parser, what search and replace, truncate the string and the like. However, there is a difficulty at this stage, that is, the problem of character encoding. If you can't understand it, you can skip it first, otherwise, it's best to solve this problem at this time to avoid future troubles;

4. The characteristics of basic object-oriented or functional programming are nothing more than inheritance, polymorphism, Lambda functions, etc. If you have experience, you will quickly understand;

5. Exception, error handling, assertion, logging and debugging support, support for unit testing . You don't have to use TDD, but you should master the basic skills of doing TDD in this language at this time;

6. The organization mechanism of program code and executable code, runtime module loading, symbol search mechanism , this is a difficult point for beginners, because most books do not pay much attention to introducing this extremely important content;

7. Basic input and output and file processing, the organization of input and output streams , this is usually a more tedious part, you can learn it in an outline, figure out the concept, and check it when you use it. At this stage, most console applications can be written;

8. How does the language perform callback method calls and how to support the event-driven programming model. In a modern programming environment, this problem is a core issue involving development ideas. Almost every language will use sufficient effort here, such as delegate in .NET, anonymous inner class in Java, closure in Java 7, and tr1 in C++OX. ::function/bind, various. If you can thoroughly understand this problem, not only will the program not be written too out of shape, but also you will have a better understanding of the design ideas of the language;

9. If necessary, you can study regex and XML processing issues at this time, and skip if not necessary;

10. Serialization and deserialization , just master the default mechanism;

11. If necessary, you can learn about the thread, concurrency and asynchronous call mechanism, mainly to understand other people's code, if you want to write this kind of code, you must spend time to study it seriously and systematically, and it is strictly forbidden to go into battle;

12. Dynamic programming, reflection and metadata programming, mutual conversion mechanism between data and program, runtime compilation and execution mechanism, aspiring developers can make more efforts in this area, which can make you understand the language one level higher

13. If necessary, you can study the language's support for generics. You don't need to spend too much time, as long as you can use ready-made generic collections and generic functions, you can take time to study systematically in your spare time. It should be noted that generic technology is the same as multi-threading technology. If it is not used properly, it will become the root of all evil.

14. If you still have time, it is best to consult an experienced person to see what the more commonly used features of this language are. If you have not learned it before, you should make up for it. Such as Ruby's block interator, Java's dynamic proxy, C# 3's LINQ and extension method. If you don't have time, I think you can learn by doing, no big problem.

15. If necessary, in the spare time of work, you can focus on two questions. First, what are the idioms and patterns of this language, and second, the compilation/interpretation execution mechanism of this language.

At this point, the basic part of the language can be said to be mastered. After that, whether to do database, network or graph, you can do it according to specific needs, find a corresponding mature framework or library, learn by doing, and deepen your understanding. For a vulgar language, it will take me about 2-3 weeks to go through the above content by myself. It is not very fast, but it will not delay too many things. After all, it is not every month to learn a new language. Once you have mastered the above content, you will be able to lay a solid foundation for practicing martial arts. Although it may not be very good, it must be rooted and young, and you will not have to go around big detours in the future. Even if it is a temporary language, simplify the above outline and only look at the parts with heavy blue fonts. It can be done in a few days to a week. It is not too time-consuming, and the code written will not be too unreliable. .

The above outline does not address the memory model. For C/C++, this issue is important and should be considered in a prominent position, but for other languages, this issue is transparent, and unless you are doing a hardcore project, you don't need to pay too much attention.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325685631&siteId=291194637