3 ms·
Go is simple in the sense that there is very little "magic", i.e. very little code that executed that might not be obvious right away: No constructors, no destr
by krylon 8y ago
Go is simple in the sense that there is very little "magic", i.e. very little code that executed that might not be obvious right away: No constructors, no destructors[0], no operator overloading, etc. This makes relatively easy to get a reasonably-accurate mental model of what is going on. Perhaps more importantly, its community has a culture that encourages simplicity of design, avoiding fancy tricks, etc.
Using features like concurrency and interfaces in ways that are considered idiomatic is not exactly trivial, I think. But it's not that hard, either. At work, I have been using C# quite a bit lately, and while I think it is a well-designed language, it is far more complex than Go (cough async cough).
I don't think what you are saying is wrong, but I think the title of the posting is easily misunderstood.
[0] IIRC, one can ask for a "cleanup" function to be called when an object is about to be harvested by the garbage collector, but one has to do so explicity, and from what I have seen, it is not used commonly.
- tapirl 8y agoFor the "cleanup", do you mean finalizers? The runtime.SetFanalizer was ever one of my confusions. https://go101.org/article/unofficial-faq.html#finalizers https://go101.org/article/unofficial-faq.html#finalizers
- krylon 8y agoYes, I was thinking of finalizers. To me, the main problem with them is that I have no control over when/if they get run. Fortunately, there is defer. ;-)