This is a creation in Article, where the information may have evolved or changed.
Go is a compiled, hair-style, and garbage-collected programming language developed by Google. Robert Greysmore (Robert griesemer), Rob Paik (Rob Pike) and Ken Thompson began designing the Go language in September 2007, [1] and later Ian Lance Taylor, Russ Cox joined the project.
The go language, the work of Daniel, a big company Google, is not so appealing and popular as C # from Microsoft's Anders Hejlsberg. Actually, the designer of Go language is also famous Daniel, but why Three Stooges, Not even a Zhuge Liang. I first contact the go language for beginners to say superficial views.
" FMT " Func Main () { fmt. Println ("Hello,World")}
Look at this hello world above. First there's a problem. Go claims to be closest to C but the goal is to replace C. But this famous hand of the thing, in my beginner's view there are two major problems.
1. No punctuation, grammar is very close to C, but there is no sign, it is like we write articles, read accustomed to the comma period, suddenly there is a thing number out of no, will be very unaccustomed. This code at first glance thought the lame C starter wrote Hello world.
What is the 2.FMT library? Look at the name is not out of sight, unexpectedly Daniel for the name also and beginners, beginners learn a language, generally must first from the Hello World. Start with the console output. This opens a bad head for beginner learners.
Take the wiki example
Package main Import ("OS" "Flag" //command line option parser) varOmitnewline = flag. Bool ("N",false,"don ' t print final newline") Const(Space=" "Newline="\ n") Func main () {flag. Parse ()//Scans the ARG list and sets up flags varSstring="" forI: =0; I < flag. Narg (); i++ { ifi >0{s+=Space} s+=flag. ARG (i)}if!*Omitnewline {s+=Newline} os. Stdout.writestring (s)}
First, in the sense of beginners, first of all, the so-called beginners, in fact, most of the current knowledge of C, C + + or something else, because the school has this course. And then the next year, this heap of code. Intuition tells me that this is like a C or C + + or what beginners write, do not pay attention to grammar, A code that is riddled with bugs. Because the average beginner likes two things, one is to forget where the grammar is going to be in brackets. and punctuation.
Of course, this is probably the reason that the designers have taken into account the factors, they simply do not need to. But the problem is, if you write about the C-Class code, write it or look at it, it will feel less comfortable, and then cut back to Class C, too. Tangled in punctuation. Python is the same on this point, but Python is forced At least you don't think you're writing a C class program.
var s string = "" is such a variable definition and does not quite understand why to do so, from the beginner's point of view is not easy to understand. Of course, except for those who have no direct contact with any programming language.
for 0 The same variable definition and assignment statement, this: = What's going on? Why is it not the same as the variable definition above? From the beginner's point of view is not easy to understand. Of course, except for those who have no direct contact with any programming language .
From the grammatical level, without careful consideration of the user's feelings of the design, so that users create a messy feeling. This reminds me of the start key of Windows8. Maybe it's a better design, but it's not good at first.
Of course, go provides some new ideas, such as the combination of the paradigm, simply said, as long as the method signature is the same, it can be used as an interface, this is a good idea, dynamic language is the way to do it. C # Delegate and interface do the same. But different. Go does this implicitly. (Maybe it's inaccurate, because I didn't read the go language carefully.)
In my initial shallow point of view, go language failed to carefully design the expression of the language, the beginning of the mistakes of many beginners, the function is strong, so Hello World program blocked People's learning desire. Maybe someday, go will shine, let people overcome the small problem of entry to use it.