See the Go language introduction to think of

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

These things are encountered at ordinary times, feel that there is a certain value, so record down, after encountering similar problems can be consulted, at the same time to share the people can be easily needed, reproduced please indicate from ringofthec[ring.of.the.c@gmail.com]

Look at the go document these days to see this passage:

    Go is a new language. Although it borrows ideas from existing languages, it had unusual properties that make effective Go programs different in Character from programs written and its relatives. A straightforward translation of a C + + or Java program into Go are unlikely to produce a satisfactory result-java programs is written in Java, not Go. On the other hand, thinking about the problem from a Go perspective could produce a successful but quite different program . In the other words, to write Go well, it's important to understand its properties and idioms. It's also important to know the established conventions for programming on Go, such as naming, formatting, program Constru Ction, and so on, so this programs you write'll be easy for other Go programmers to understand.

Go is a new language. While it draws on features from many other languages, it is essential to write an efficient go program and the programming of the go language with other languages. If you simply translate code such as C + + and Java into Go code, you won't get the best go code. Java programmers use Java's way of thinking, not go. If you use go thinking, then a problem may have a completely different solution. So if you want to really use the go language, you have to understand its language characteristics and design ideas. Also know the programming style of the go language, such as naming, formatting, program structure, etc., in a common way can also be easy to communicate with other go programmers.

I think this passage is not only applicable to the go language, but also has a guiding meaning when learning any language, and it means "how to learn a new language". That is, do not preconceived, take new things, hard to go to their own habits, of course, will find it difficult to use or not adapt. Don't think you can write HelloWorld or echoserver in a new language and feel like you know it. It can be said that the difference is too far.

Remember the first time to learn computer, learning is basic, and then heard that someone will c/c++/pascal, immediately from the heart of reverence, think this person is too cow, too powerful. But with the study and in-depth learning, slowly found that there will be more languages, than proficient in a door, and in many places you can also hear "data structure and algorithm is the fundamental" such rhetoric, indeed, language is just tools.

When you solve the problem, you need to reasonably describe and organize the problem, the language is an implementation tool, may be living in the "Long live xx, down uu" non-friend is the enemy magical country, I suddenly despise the former self, at this time, if who said a few languages, the heart will involuntarily despise the people, But he also came from this time, it is called growth.

But there is a famous saying: The whole history of mankind is to repeat the same mistake all the time. After a period of study and practice, my ideas have changed, of course, not to say that my algorithm and data structure have a lot of meaning, but to say that the horizon is open, see more things, the understanding of the problem can be deeper, more objective. I also found that language is very important, not a simple implementation of the tool, what kind of language, take you in such a direction.

Why do you say that, because different languages are invented by inventors at the time to solve different problems, you can learn a language, but also because of its ability to excel in a certain aspect of providing you with value. So you are bound to be influenced by the way in which a particular problem is addressed in a language, and what patterns of usage, libraries, and frameworks are subtly influencing the way you view the problem. Then you have two ways to go:

1. Make good use of the language and force yourself to learn more types of language and broaden your thinking
2. When a faithful believer in a language, confine his ideas to the development of the language

From the will of course everyone would like to choose one, but it is not necessarily true to do so. Choose one of the benefits will not say, the different languages of the world view and methodology will greatly enrich your mind, that is, because of this, I once again feel that language is always. Some languages you do not learn, you do not know the original problem can be solved, after all, can have heard the language has its characteristics, this is a huge wealth, and pay just a few learning costs.

Of course, can also hold their favorite language, in fact, there is nothing wrong with doing so. Because you came to a place full of treasures, but you are undertakes, so there is no mistake, but you are more than a disadvantage, I always point out that the truth is clear, the road himself, because life is his own, others have no energy or obligation to persuade anyone, concentrate on digging their own treasures, Then write your own experience as a legend, the fate of the natural benefit of people.

Well, I feel I am a little tricky too much, just feeling and hair, I actually want to say how to learn a language, I am not a master, nor what is called beast, I can only give some examples to illustrate, which I am familiar with, there are unfamiliar.
C/c++/java Unknown learning method, I do not know how to learn
Lua/js Big love, table, tables, UserData, C API, the source is very few, the best is to read, this is valuable, package you do not regret, after learning Lua, JS self-pass,
Gamemonkey learned the case of Lua can learn, and its scheduling, the other nothing, mainly to see the source code, write very clear, see Lua again see it is easy, notice that the GM and Lua is two to abandon preemptive scheduling, select the shared memory example.
Go channel, Goroutine, memory model. [Ready to learn], go and LUA, GM just the opposite, it discards shared memory and chooses preemptive scheduling. These are the key points of study.

That's it, in fact inductive is, 1. Learning it differs from other language features, 2. To choose a language from the source of the complete fix [in order not to arouse everyone's dissatisfaction, I actively comment: I mean a small dynamic language, 1w up and down the amount of code, I think to read static language compiler does not benefit, is a waste of time].
I think the more regrettable is to now for functional programming or conceptual cognition, this must take time to learn a bit.
Of course, we all have different ways of learning, there is no omnipotent method, the most important is to adhere to and pursue. This article is purely to talk about their own experience, all the way.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.