Yes, what I am going to talk about here is not how to master a programming language, but all. If you have the following confusions, this article may help you:

You are a beginner in programming and don't know what programming language to choose to get started.

You are a senior programmer or team leader who is confused about emerging languages ​​and doesn't know which language to "invest".

Your team is arguing over which programming language to use, and there are various struggles.

You chased the trend with a fashionable language, and after two months it found that it was in a quagmire.

The programming language has always been a very important topic, and this situation will not change in a short time. The position of the programmer often requires familiarity with certain languages, and even some wonderful companies require you to "understand the OOP or FP design patterns." For working programmers, the programming language is still a topic that can be blushing.

Pay attention to language characteristics, not language

Many people care about whether they or others "will" speak a certain language, and worship people who have "invented" a certain language, and they are eager for the good and bad of various languages. These problems don't exist for me. Although I wrote an article criticizing many language flaws, I rarely argued with people in practical work. why? I find that the reason is ultimately because I value "language characteristics" rather than the entire "language." I can write good code in any language, even if the bad language is not much different.

Any kind of "language" is a combination of various "language characteristics." For example, a programming language is like a computer. Its brand may be called "Lenovo", or "IBM", or "Dell", or "Apple." So, can you say that Apple must be better than IBM? you can not. You have to look at what type of processor is installed in it, how many cores, how many clocks, how many L1 caches, L2 cache..., how much memory and hard disk, how big the monitor resolution is, what GPU is the graphics card , NIC speed, and so on, various "configurations." Sometimes you have to look at the compatibility between the various components.

These configurations correspond to the programming language and are called "language features." Give some examples of language features:

·

Variable definitions

· Arithmetic operations

· for loop statement, while loop statement

· Function definition, function call

· Recursion

· Static type system

· Type derivation

· lambda function

· Object-oriented

· Garbage collection

· Pointer arithmetic

Goto statement

These language features, like when you choose a computer, look at what configuration is inside it. When choosing a computer, no one would say that Dell must be the best. They only say that this model is equipped with Intel's i7 processor. This is better than i5. DDR3 memory is much faster than DDR2, SSD ratio. The disk is much faster, ATI's graphics card is junk... So wait.

The same is true for programming languages. For beginners, there is no need to entangle in which language to learn first, and which one to learn. Someone once sent me a letter asking this question, and it has been entangled for several weeks. As a result, a language has not yet begun to learn. With this tangled time, in fact, all the language he has entangled can be mastered.

Beginners often don't understand that there must be a set of "universal" features in each language. Such as variables, functions, integers and floating point operations, and so on. These are all necessary in every general programming language, and one must not be less. You can apply these knowledge to any other language at any time by learning these features in "a language" and mastering the underlying concepts of these features. The time you put into it is basically not wasted. So beginners struggle to "first learn which language", this time is not worth it, it is better to pick a language and jump in.

If you can't write good code with the basic features of a language, then switching to another language doesn't help. You will write the same bad code. I often see that some people write Java code quite messy, quite bad, but Java is not good, and ambitious to switch to Go language. These people do not understand whether it is possible to write good code in people, not in language. If you don't have a clear and simple mindset in your mind, it's a mess in any language. If your Java code is badly written, then your Go code will be just as bad or worse.

Many beginners don't understand that if a clever programmer starts using a new programming language, he often doesn't go to the big manuals or books of the language, but has a problem to solve first. If you have a problem at hand, he can take a two-minute look at the language manual to see what the language looks like. Then, he took a sample code directly to start modifying the drums, and thought to change the code to the problem he was trying to solve. In this short process, he quickly mastered the language and used it to express his thoughts.

In the process, as the demand arises, he may ask such questions:

· What is the grammar of the "variable definition" of the language, do you need to "declare the type", or can you use "type derivation"?

· What is the grammar of its "type"? Does it support "generic"? How is the generic "variance" expressed?

· What is the syntax of the "function" of the language, what is the syntax of the "function call", can I use the "default parameter"?

Did you notice? The content inside each quote is a language feature (or concept). These concepts can exist in any language, although the grammar may be different, and their essence is the same. For example, some language parameter types are written before variables, some are written later, some are separated by a colon, and some are not.

These practical problems are all brought up with the actual code, to solve the problem at hand, rather than holding the language manual at the beginning to see carefully. Because people who have mastered the language characteristics know that the characteristics they need, there must be a corresponding expression in any language. If there is no direct way to express it, then there must be some sort of "bypass". If there is a direct expression, then it is just a slightly different grammar. Therefore, he is looking for features with problems, just like looking up a dictionary, instead of being drowned in the manual of the big head, and slumbering for a month to start writing code.

Mastering the general language features, the rest is only the "unique" features of some languages. Anyone who studies languages ​​knows that it is very difficult to design new, good, and harmless features. So in general, a good language, its unique new features, will not exceed one or two. If there is a language claiming that you have more than 5 new features, then you have to be careful, because they bring and may not be an advantage, but a disaster!

By the same token, the best language researchers are often not designers of a certain language, but designers (or supporters) of certain key language features. For example, the famous computer scientist Dijkstra is a strong supporter of "recursion." There are recursions in the current language, but you may not know that early programming languages ​​did not support recursion. This situation changed until Dijkstra strongly urged the Algol 60 committee to join the support for recursion. Tony Hoare is also a language feature designer. He designed several important language features but did not design any language. In addition, don't forget that there is a linguist called Wang Hao, who is a supporter and implementer of the early union type and a supporter of the checked exception feature. He pointed out in his blog post between checked exception and union type. relationship.

Many people blindly worship language designers. As long as they hear someone designing (or "the invention" invented a language), they will be excited and admire the five bodies. They did not understand, in fact, all programming languages ​​are just "assembly machines" like Dell and Lenovo. The designer of language features is the creator of core technologies like Intel, AMD, ARM, and Qualcomm.

Reasonable entry language

Therefore, if beginners want to do more with less, they should start with a "reasonable" language with no obvious serious problems, master the most important language features, and then apply these concepts to other languages. What are the reasonable entry languages? I personally feel that these languages ​​can be used to get started:

· Scheme

· C

· Java

· Python

· JavaScript

So by contrast, which languages ​​do I recommend for getting started?

· Shell

· PowerShell

· AWK

· Perl

· PHP

· Basic

· Go

· Rust

In general, you should not use the so-called "scripting language" as the starting language, especially the scripting language tools that originated from earlier Unix systems. Although PowerShell has improved over Unix's Shell, it still doesn't get rid of the fundamental problem of scripting languages ​​- their designers don't know what they are doing.

Using scripting linguistic programming, a serious problem is that learners can't grasp the key. Scripting languages ​​often add some of the nature of system tools (such as regular expressions, Web concepts) to the grammar, causing beginners to waste too much time on them, but do not understand the most critical concepts of programming: variables, functions, recursion, types .

The reason for not recommending the Go language is similar. Although the Go language is not a scripting language, his designers obviously don't understand what they are doing. So using the Go language to learn programming, you can't focus on the most critical and best language features.

Again, I don't think Rust is suitable as an introductory language. Rust has spent too much energy boasting about its "new features," and these new features are not only the most critical parts, but many are problematic. Beginners pay attention to these characteristics too early, not only do not learn the most critical programming ideas, but may also go astray.

Master key language features, ignoring secondary features

In order to achieve the integration that I mentioned before, the effect of a pass, the beginner should focus on the most critical characteristics of the language, rather than being distracted by secondary features.

Give an exaggerated example. I found that many introductory classes in programming classes often teach students how to use printf to print "Hello World!", and then ask them to remember the meaning of printf's various "format characters" and ask them to print in a variety of complex formats. Output, even require printing to a text file, then read it out...

But as everyone knows, this kind of output input operation is actually not part of the language, and it is secondary to mastering the core concept of programming. Some people have been working on Java courses for several weeks, and they are still working on various printf jobs. Students write a few hundred lines of printf, but do not understand what variables and functions are, even the arithmetic and loop statements do not know how to use! This is why many beginners feel that programming is difficult. I can't remember the meaning of %d, %f, %.2f, and how to learn programming!

However, the "Professor" title of these Pheasant University is so brainwashed that the students they taught (such as my girlfriend) came to me to ask for advice. Actually, I taught me some useless things and learned the work of even printf. Can't do it: P Don't tell me about the for loop, what's the function... Can you wait a few months, wait until I get familiar with the usage of printf and learn those?

So you find that once taught by a bad teacher, this programmer is basically destroyed. Even if they meet a good teacher, they will have a hard time correcting them. Of course this is an exaggerated example, because printf is not a language feature at all, but this example illustrates the problem of minor superficial language features from the same perspective.

Here are some examples of minor language features:

· C language statement block, if there is only one statement inside, you can not use curly braces.

· The function parameter types of the Go language can be combined and written together, such as func foo(s string, x, y, z int, c bool) { ... }

· Perl uses regular expressions as a special syntax for languages

· JavaScript statements can omit the semicolon at the end of the sentence at some point

· Curry of languages ​​such as Haskell and ML

Do it yourself to achieve language features

After learning the various language features and using them to write code, the next step is to implement them. Only by implementing various language features can you fully own them and become their masters. Otherwise you are just their users, you will be led by the language designer.

One master said well that the best way to fully understand a language is to implement it yourself, that is, to write an interpreter to achieve its semantics. But I think this sentence should be slightly modified: the best way to fully understand a "language feature" is to implement it yourself.

Note that I changed the "language" to the "language feature" here. You don't need to implement the entire language to achieve this, because we end up using language features. As long as you implement a language feature yourself, you can understand how this feature is implemented and used in any language.

For example, when learning SICP, everyone will use Scheme to implement an object-oriented system. The object-oriented system implemented with Scheme is far from the language syntax of Java, C++, Python, but it can help you understand the concept of "object-oriented" in any of these OOP languages. It can even help you understand. Differences in various object-oriented implementations.

This effect is not available to you directly learning the OOP language, because when you are learning Java, C++, Python and other languages, you are just a user, and after you implement the OO system with Scheme yourself, you become a creator. .

Similar features include type derivation, type checking, lazy evaluation, and so on. I have implemented almost all the language features, so any language in front of me is a toy that can be disassembled and assembled, and is no longer a sacred over me.

to sum up

Write so much, repeat important three times: language features, language features, language features, language features! Whether it is a beginner or a senior programmer, you should focus on language features rather than entangled in the entire "language brand." Only in this way can we achieve integration, pick up any language and use it almost immediately, and write high quality code.

Elf Bar 5000 Puffs

The Elf Bar BC5000 has a dual mesh coil with 13ml e-juice, 5% Nic and a rechargeable 650mah battery and 5000 puffs. The package is 10 pack per box, each box one flavor. You can select the flavor as you like, such as elf bar 5000 peach ice, elf bar 5000 strawberry kiwi, elf bar 5000 mango ice etc. Flavor is selectable for you!

Elf Bar 5000 Puffs,Elf Bar 5000,Elf Bar 5000 Flavors,Elf Bar Bc5000 Disposable

Shenzhen Kate Technology Co., Ltd. , https://www.katevape.com