Feel after using the go language

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

Two days ago I said that in order to learn the go language to learn python, when I finished the Python study, yesterday noon went to learn the go language. Hereinafter referred to as the Golang.

The operating system I use is Windows Xp,golang support for XP, but when I was learning Python3, the 3.5 version of Python did not provide support for XP. I learned the code of Golang in http://gobyexample.com, I don't know the grammar is completely incomplete. Secondly, the essence of Golang is a static type of language, but it can be written as a dynamic type of language declaration, which can be said to be a static language revolution.

  Let me talk about my feelings for Golang.

 First, I feel that Golang's grammar is really like Python, which makes it feel comfortable and quick to use. For example:

Declaration-Class Pythona: = Ten    //A at compile time will be automatically converted to int type//syntax  -Class cfor I: = 0; i <; i++ {    //do something here}

  Second, Golang has a high degree of freedom and code simplicity, for example:

There are 3 ways to declare a variable of type int var v = 10var V int = 10v: = 10//declares a constant there are 2 ways to use const V = 10const V int = 10//Loop--for is OK for True {    //similar to the while loop in C}for {    ///For true abbreviated version}for I: = 0; i < ten; i++ {    //similar to the For loop in C}

  Thirdly, I think the purpose of Golang language is not strong, strictly speaking is a confusing language, look at the following code:

Golang Loop Example for I: = 0; I < 10; i++ {}/* * See the above code at the beginning, so that we feel there is nothing wrong, but after learning, we will know the clues.  * Question 1, where the i++ cannot be changed to ++i,golang does not support ++i such an operator * Problem 2, the Oita number can not be another row * problem 3, if there is only one line of code in the loop, "{", "}" can not write *///Golang simple example Do While loop examples-with for Implement var i = 0for {    //do something there    if I >= {break    }    i++}/* * Same as above, no hours do not know how deep the water * Question 1, support I The + + operator is not supported as such if i++ > 10 * Question 2, not as simple as the Do While loop, good-looking */

  The above example shows that Golang is still a free language! Not only that, Golang cannot accommodate extra statements:

Pacakge mainimport "FMT" import "Math" Func Main () {    var i int = 9    var J int = Ten    fmt. Println (i)}/**  compile times Error: Imported and not used: "J" *  imported and not used: "Math" *  Besides, Golang is also perverted to Packge XXX begins, and the main () function cannot place either parameter and cannot declare any return value and return any value. */

  Golang finally gave me the feeling is a mess, so far, I think Golang although concise, but it is not a good programming language.

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.