Home > other >  Learn some experience of the language
Learn some experience of the language

Time:11-19

Business time, learn to go off and on for a year, to appreciate the language is not a true high level language, although it has some characteristics of the high-level language, such as gc, but accurate positioning, it is a language between low and high level language, like Java, c #, you don't need to know about the underlying things too, such as an array, the ArrayList, dictionary, only need to know the function, using the basic won't be a problem, go not, you must to understand the underlying object to, needless to say, having a lot of all understand, but at least to understand, understand what pit, pit too much,

For example:
1: var I * int light this way, you will know it is a pointer to nil, pointing to the memory address is 0, I==nil, use it to call a method, assignment, are wrong, because the go in 0-255 memory address is the retention system, does not allow for any operation, do you want to know the null pointer!=nil, only the pointer type of dynamic and dynamic value is empty, only equal to nil, null pointer is dynamic value is empty, dynamic type is not null, then it is!=nil, it is likely to go wrong in be used actually,

2: the for k, v:=range t, t you know is just a copy a copy of the v just duplicate values at a time, will not change the address, so don't use & amp; V or take forever to the address of the last cycle v,

3: slice, for example, you use from the array s [I:] j to intercept generate slice, slice the bottom in a while might actually be an array, and the original array is Shared, so you changed slice an element value, the value of an element corresponding to the original array is also changed,

4: slice, for example, to append elements, plus more than capacity, will generate a new memory address section, if you are the original section in the main, append in a function, not return a new section, you will happen in the main old section will not have any change,

5: for example, a function func test () r int {
Defer func () {
.
} ()
The return of 6
}
Return r=6 is not atomic operations
It can be decomposed into three step
A: r=6
2: perform the defer
Three: empty return


.


Too many, so don't be so quick to research framework, research code, others have any free time to play good foundation first, or make something, once there is a problem, it's difficult to find the reason, I have it, a go exe program service, always run a few days to collapse, the last for a long time didn't grasp the good thing is basis,

CodePudding user response:



Go on fire for a moment, then no then

CodePudding user response:

reference 1st floor tangyanzhi1111 response:
go on fire for a moment, then no then


Also good, with many large enterprises, small and medium-sized enterprises is the same, with much and original technology is mature, there is no necessary to change, may have some relationship between too much and go pit, a began to feel very studious, time is long feel not so easy,

CodePudding user response:

reference 1st floor tangyanzhi1111 response:
go on fire for a moment, then no then


No, as far as I know now recruit golang company are:

Ali, Scott
Tencent, drops
Baidu

Need for more

CodePudding user response:

Ha ha, I think it is a question of habit
Accustomed to a kind of language, turn to another language, will continue to use a language habit before
Every language have the same place, also have different places, it is the language differences, or united into a kind of language

CodePudding user response:

Any one technology or language has it to take care of the place, as a tool users, take its required, welcome to watch me, everybody together communication
https://blog.csdn.net/u012737673
  • Related