I am still not sure why the language creators of Go decided to make pointers explicit (syntactically) instead of making references the default like most other languages. That is you still have pointers but you don't have to put "*" all over the place. I suppose it is because the language designers came from C or maybe they wanted to be that explicit?<p>I understand the value of having pointers even in a GC but I'am actually more concerned with the resource I'm pointing to and its lifecycle than that is pointers. That is there should be different types of pointers depending on where the data is stored and how it is reclaimed (something Rust does nicely with generics).<p>I'm not trying to bash Go rather I must be missing something (I don't know the language that well).
I clicked the article thinking that Go pointers are something special... but this seems targeted at the "programmers" who only know javascript...
Looks the same as C pointers. Maybe the title is more clear if it would be: "Understand pointers, using Go". Then for a C programmer it's clear from the title that "pointers" is the same concept, and Go doesn't have a different type of "Go pointers".<p>Or instead of starting with:<p>"This post is for programmers coming to Go who are unfamiliar with the idea of pointers or a pointer type in Go."<p>It could start with:<p>"This post is for programmers coming to Go from a language without pointers or a pointer type."
The article referenced 'Cuneiform' which I had to Google. It's neat to see that languages evolved the same way math was developed and similar to how software programs grow as a series of expanding abstraction:<p>> Emerging in Sumer in the late fourth millennium BC (the Uruk IV period), cuneiform writing began as a system of pictograms. In the third millennium, the pictorial representations became simplified and more abstract as the number of characters in use grew smaller (Hittite cuneiform).<p>Software is very much a natural extension of the brain and how we processed the world around us.
Are there actually programmers who need to be explained the following: "...memory is just a series of numbered cells, and variables are just nicknames for a memory location assigned by the compiler."<p>What kind of programming can one do without even that level of mental model of what a computer does?
Thank you! This is extremely useful!<p>I've always wanted to break into Go, but pointers scare me after my experience in C in University. While I got the usefulness and it's functions (and usage), it was not something I felt comfortable with.<p>This definitely it easier!
"Understand Go pointers in less than 800 words or your money back"<p>There are multiple pictures each of which is worth 1000 words. Where is my money?
This is a good explanation of what happens on the machine.<p>However, most languages (C, C++, etc) have different definitions of what pointers are, and many operations that seem reasonable on the machine model are in fact undefined behavior.<p>In C, for example, you cannot reference one object from a pointer to another object (there is one exception to this rule).