How to master all the programming languages Shangxue Tang Xian

Yeah, I want to say here is not how to master a programming language, but all ......
many programming beginners are still wrote to me to ask, ask me what the programming language to learn, how to learn. Since I know the answer to the title question, so always feel this issue is so "low level", he has not had time to reply: P But gradually, I found out that not only the white are having this problem, and even many experienced engineers, large US companies , in fact, not understood.
Today, leisure activities into the second week, retired and sit a little bit, I wanted to answer this unified long-stalled "primary issue." This topic seems to have written, but now I want to re-write it again. Because a lot of people through the exchange with my own mind (not translated into the language of) the idea, we have a more accurate expression.
If you are following all sorts of puzzles, then this article might be helpful to you:
you are a novice programmer, do not know to choose what programming language to get started.
You are experienced programmer or team leader, confused about the various emerging language, do not know the "investment" which language.
Your team is debating which program to use language, religious struggle occurred.
You chase the trend adopted some fashionable language, the result after two months found stuck in a quagmire in pain ......
although I no longer say in these things, but no doubt the reality is that the programming language is still very important topic this situation will not change in a short time. Programmer's job often requires familiarity with some of the language, and even some of the wonderful work you have been asked, "or FP-depth understanding of OOP design patterns." For the job of programmers, programming language is still the topic of religion can win red in the face. Its religious strong that I criticize and ridicule in some languages (such as Go language) when some people will instinctively thought I was a fan of another language (such as Java) are.
Obviously I can not be a fan of any one language, I'm not even a fan of Yin language;) for any language never seen before, I always use direct pick-up, without having to go through the learning process. Read this article, maybe you will understand why I can achieve this effect. Understand this stuff inside, every programmer should be able to do this. Ah, I hope it.
Emphasis on language features, rather than the language
a lot of people care about whether their own or someone else "will be" a language of people "invented" a language doubly worship, fierce arguments for the merits of various languages. The problem for me is non-existent. Although I wrote articles critical of a lot of defects in language, in practice I rarely argue with these people. If there are other people around me arguing, I would even wear headphones, too lazy to listen to what they say;?) Why do I find the reason the final analysis, because my attention is the "linguistic identity", rather than the whole "language . " I can write good code in any language, even if another bad language that far.
Are various combinations of "linguistic identity" of any kind of "language." Analogy it, a programming language like a computer. It's brand may be called "Legend", or "IBM", or "Dell", or "apple." Well, you can say that Apple must be better than IBM, okay? You can not. You have to look at it was inside what types of processors, number of cores, clock speed number, the number of L1 cache, L2 cache ......, how much memory and hard drives, monitors how much resolution, is what GPU graphics card , LAN speed, and so on various "configuration." Sometimes you have to see the compatibility between the various components.
These configurations correspond to a programming language which is called "linguistic identity." Give some examples of language features:
· Variable Definition
· Arithmetic operations
· for loop, while loop
· function definition, function calls
· recursive
· static type system
-type inference
· lambda function
Object-oriented
· Garbage collection
· pointer arithmetic
· goto statements
these language features, just as you choose a computer when it inside to see what configuration. Choose the computer, no one would say Dell must be the best, they would only say that this model was inside Intel's i7 processors, the i5 is better than, than DDR2 memory is so much faster DDR3, SSD than disk drives are much faster, ATI graphics card is rubbish ...... and so on.
Programming language is the same reason. For starters, in fact, what kind of language is not necessary to first learn tangled in the end, which to learn. Someone once gave me a letter to ask this question, tangled for several weeks, the results have not started to learn a language. This time there are tangled, in fact, can he tangled over all mastered the language.
Beginners often do not understand, every language which will inevitably have a "generic" characteristics. Such as variables, functions, integer and floating point arithmetic, and so on. These are each universal programming language which must have, one less. You only through "a language" learned these features, simply grasp the concept of these features, you can feel free to put this knowledge into any other language. You put in the time base will not be wasted. So beginners to tangle "what language to learn," this is not worth the time spent, you might as well just pick a language, jump into.
Many beginners do not know, a clever programmer if you start with a new programming language, he tends not to look at this language voluminous manuals or books, but first there is a problem to be solved. With the issue at hand, he can look at the language of this manual with two minutes to see if this language probably look like. Then he picked up some example code to directly modify began to fiddle, put the code into the idea of trying to solve their own problems. In this short process, he quickly mastered the language and use it to express the idea of a heart.
In this process, as the need arises, he might ask the question:
· "variable defines the" grammar of this language is what is required, "declared type" it, or you can use the "type inference"?
• It's "type" is what grammar? Whether to support the "generic"? Generic "variance" how to express?
· "Function" This is what the language syntax "function call" is what grammar, can use the "default parameters "?
* ......
noticed? contents of each of the above quotes, is a language feature (or called concept). These concepts can exist in any language which, though syntax may be different, their essence is the same. For example, some types of parameters are written in the language before the variable, some written on the back, some in the interval of a colon, and some do not.
These are practical problems with writing the actual code, solve the problem at hand, naturally bring out, rather than holding the outset to see the language manual carefully. Mastering the language features of people know the characteristics they need, in any language, there must be a corresponding expression. If there is no direct way of expression, then there must be some sort of "bypass mode." If there is a direct expression, then it is only just slightly different syntax. So, he is looking for properties with a problem, just look up the same, instead of being submerged in the voluminous manual inside, sleepy month to start writing code.
Master the common language features, the rest is only some language "unique" features a. The study of language people know, to design a new, good, harmless characteristics, it is very difficult. So in general, a good language, its unique new features, after all, is not more than twelve kinds. If there is a language known as they have more than five kinds of new features, you have to be careful, because they bring and may not be advantages, but disaster!
By the same token, the best language researchers, more often than not a language designer, but designers of some key language features (or supporter). For example, the famous computer scientist Dijkstra is "recursive" a strong supporter. Now there are recursive language, but you may not know, the early programming languages do not support recursion. Algol 60 until Dijkstra strongly urge the Commission to add support for recursion, this situation was changed. Tony Hoare is also the language features designer. He designed several important language features, but did not design any language. Also we should not forget that there is a language expert named Wang Yin, he was an early supporter of the union type and implementers, supporters also checked exception characteristics, he pointed out between the checked exception and union type in your blog Lane relationship: P
a lot of people blindly worship language designers, whenever they hear someone design (or the United States, saying its people "invented") a language, the blood boiling, admire the five-body cast. They did not understand, in fact, all of the programming language, but like Dell, Lenovo, like the "assembly machine." Designers language features, is like Intel, AMD, ARM, Qualcomm as the core technology creators.
Reasonable introductory language
so beginners in order to be more effective, it should be from a kind of "reasonable", there is no obvious serious problems of language starting to master the key language features, and thus apply these concepts to other languages. ? What is a reasonable introductory language do I personally feel that these languages can be used to Getting Started:
· Scheme
· C
· the Java
· Python
· JavaScript
so by contrast, which I do not recommend introductory language use is it?
· Shell
· PowerShell
· AWK
· Perl
PHP ·
· Basic
· Go
In general, you should not use so-called "scripting language" as the introductory language, especially those scripting language tools from the early Unix systems. Although some progress PowerShell than the Unix Shell, but it still did not get rid of the underlying problem of a scripting language - their designers do not know what they're doing: P
using scripting linguistic programming, a very serious problem is to make the learner grasp live key. Scripting languages tend to put some system utilities kinds of things (such as regular expressions, Web concepts) added to the grammar inside, leading to a beginner waste too much time for them, but most do not understand the programming key concepts: variables, functions, recursion, type ......
similar to the language of reason is not recommended Go, Go though the language is not a scripting language, but his designer obviously does not understand what he was doing. So use the Go programming language to learn, you can not focus on the most critical, the best language features.
Master the key language features, ignoring secondary characteristics
in order to achieve mastery I mentioned before, a pass Belden effect, beginners should focus on the most critical characteristics of the language which, instead of being distracted by secondary content. I found a lot of programming courses and grouse programming introductory course, often one to teach students how to use printf to print "Hello World!", Then they should in every sense "format string" printf memory, to achieve a variety of them printout complex formats and even required to print to a text file, and then read out ......
but everyone knows that this is actually the operating output and input is simply not part of the language, but also to grasp the core concepts of programming, it is secondary of. Some of the Java program went on for several weeks, actually a variety of jobs still printf arrangement. Printf students to write hundreds of lines, but do not understand what variables and functions that even arithmetic statements and loops do not know how to use! That is why many beginners feel Programming is hard, I could not even% d,% f, % .2f meaning of can not remember, but also how to learn programming!
However, these grouse of "Professor" title is so brainwashed that they were taught the students (such as my girlfriend) I am here to ask, actually called me to teach some of the net useless things, learn job even printf no method to complete: P you do not tell me the for loop, what's the function ...... Can you wait a few months, so I memorize the usage of printf to learn those ah?
so you will find that once they are bad teachers taught this programmer basically ruined. Even met a good teacher, she is also very difficult to correct them.
Yourself achieve language features
in a variety of languages learned basic characteristics, then use them to write code, the next step is to implement advanced them. Only by achieving various language features, you can completely owned them, become their owners. Otherwise you just their users, you will always be the language creators servants.
There is a master when he said, the best way to fully understand a language is to implement it yourself, that is, to write an interpreter to implement its own semantics. But I think this sentence should be slightly modified: The best way to fully understand the kind of "linguistic identity" is to personally achieve it.
Note that I am here to "language" to the "language features." You do not need to implement the entire language for this purpose, because we end up using the language features. As long as you realize a language feature, you will be able to understand the characteristics of the implementation and usage of any language.
For example, learning SICP time, we will personally with Scheme to achieve an object-oriented system. Object-oriented system Scheme implemented with Java, C ++, Python language syntax like a far cry, however, it can help you understand the "object-oriented" concept inside any of these OOP languages, and it can even help you understand Object oriented implementation of various differences.
This effect is not direct you to learn OOP language, because when learning Java, C ++, Python like language, you're just a user, and then use Scheme yourself to achieve the OO system, you become a creator .
Similar features include type inference, type checking, lazy evaluation, and so on. I realized in almost all of the language features, so any language in front of me, all can be disassembled arbitrary assembly of the toy, rather than above the top of my sacred.
Summary
writing so many important words repeated three times:! Language features, language features, language features, language features, whether beginner or experienced programmer, you should focus on language features, and not entangled in the whole "language brand." The only way to achieve mastery, picked up almost immediately with any language, and write quality code.

Guess you like

Origin blog.51cto.com/14512197/2439361