Learn Go in five minutes
21–30 of 137 posts
Re: Learn Go in five minutes
#22Is this a response to that "learn rust in half an hour?" ;) https://fasterthanli.me/articles/a-half-hour-to-learn-rust
Re: Learn Go in five minutes
#23Is this a response to that "learn rust in half an hour?" ;) https://fasterthanli.me/articles/a-half-hour-to-learn-rust
Re: Learn Go in five minutes
#24Learn the lambda calculus ... in just 5mins!
Learn how to write a novel ... in just 5mins!
Learn how to be a stand up comedian ... in just 5mins!
Learn kung fu ... in just 5mins!
Learn how to be a world class lover in bed (or out!) ... in just 5mins!
Man, that was the best half-hour I've ever spent in my life. Sorry, I couldn't fit in Go, though.
Re: Learn Go in five minutes
#25Good stuff. There is another >5 minute tutorial here: https://learnxinyminutes.com/docs/go/ This website has something similar for nearly every language: https://learnxinyminutes.com
Re: Learn Go in five minutes
#26Go can be understood as an improved C that keeps much of C's simplicity but adds small, powerful features like interfaces and channels and garbage collection Go fixes C's well-understood flaws (declaration resembling use, unintuitive operator precedence, unrestricted address math, silent casting, zero-terminated strings, etc.) Go puts essential C idioms directly into the language (pointer/length is formalized as slic…
I'm not a C fan but isn't Zig much closer to C's philosophy while fixing bad parts than Go? Especially due to the garbage collection, at which point Go suddenly competes with many more simple languages.
It is probably reasonable to say that Zig is closer to C's current philosophy in practice, which encompasses many additional developments over the decades to deal with various aspects of C and programming real machines that have arisen as both have changes, and Go closer to C's original philosophy of simplicity and relative ease of use. (In modern times, C is not one of the easier languages to use any more, due to significant advancements in the field of making easy-to-use languages. But it was originally intended to be an advancement there itself.)
By similar logic, I can say with a straight face that all of Go, C++, Zig, Rust, and Swift (and more) are "evolutions in general-purpose programming languages like C", despite their wild differences, because the world has gotten larger, and there is room for a lot of variations like that, each addressing different aspects of the newer, larger world.
Re: Learn Go in five minutes
#27Re: Learn Go in five minutes
#28Re: Learn Go in five minutes
#29Go can be understood as an improved C that keeps much of C's simplicity but adds small, powerful features like interfaces and channels and garbage collection Go fixes C's well-understood flaws (declaration resembling use, unintuitive operator precedence, unrestricted address math, silent casting, zero-terminated strings, etc.) Go puts essential C idioms directly into the language (pointer/length is formalized as slic…
I like C but strongly dislike Go. They share nothing other than having a small(ish) feature set.
Realize a Go []int ("slice of int") is just a C struct like this, passed by value:
struct intSlice {
int* addr;
int len;
int cap;
};
The memory at addr is not owned by the slice. All the slice operations are simply notation for manipulating the struct. Go's garbage collection makes the whole thing work wellThis can be confusing if you're used to C++'s std::vector (which owns the memory) or Python's slices. Go's slices are a shallow pointer/length system exactly like is used in C all the time. For example:
void sort(int* addr, int len);
becomes func sort(a []int)
A Go slice is just a formalization of C's pointer/length idiom, with terse notation for manipulationRe: Learn Go in five minutes
#30This is neat, and a testament to the simplicity of Go. I normally point people to this tutorial if they want to learn Go quickly, it is interactive (able to navigate straight to go playground) and very well done in my opinion. https://gobyexample.com/
As someone who's not written any Go, I found fasterthanlime's critique of the language[0] damning enough that I likely won't ever touch the thing. Maybe he's cherry-picked examples, but his article was thorough and technical enough to convince me that the Go mantra of simplicity is just surface-level.
[0] https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-...