Earlier quoted context omitted.
One nice thing these examples also do is make it really simple for detractors to point out what they don't like about it. My #1 gripe about go, for example, is this: https://gobyexample.com/sorting-by-functions In a few other languages: // C++ sort(vs.begin(), vs.end(), [](const string& l, const string& r) -> bool { return l.size() When they fix this, Go might be the perfect language for me. Until then, I'm not touch…
Why not make an interface called iCompare that has a single function: compare, which takes an object of type interface{}. You can then implement that single compare function, attached to your type of choice. Problem solved.
Go by Example
61–70 of 130 posts
Re: Go by Example
#62Earlier quoted context omitted.
I would surely never take these complaints to a go-specific discussion board. That would be disruptive and rude. But this site is not that. I will react to stories on here as pleases me, and it pleases me to constructively criticize certain go design choices sometimes when the subject comes up.
You don't fool anybody, the subject didn't come up untill you brought it. The thread is about a site that shows examples of Go code and explains them, there's no discussion about the advantages or disadvantages of their design decisions, just matter of fact statements. Of course, you can do whatever you want, but that doesn't mean that the rest of us won't probably look at your comments thinking "Here come the generi…
I can see that I am putting some people off with my commentary, but other people apparently got new information. Hard to say whether this is a win or loss on net. Time will tell, sooner or later.
Re: Go by Example
#63Nice and clean. I like it. Maybe it would be nice to have comments with up/down votability ala Stackoverflow.
- Eggs should not be washed.
Re: Go by Example
#64It's Friday gents! No excuse to set aside Saturday and Sunday, you can easily go through these examples in two days and grok it. Go is that _slim_, and that's good! Guaranteed you'll find use for Go in one system or the other when you want easy deployment, fast development time and extreme speeds. :) (Disclaimer: I love Go and I hope it goes mainstream in a big way in 5 years)
One nice thing these examples also do is make it really simple for detractors to point out what they don't like about it. My #1 gripe about go, for example, is this: https://gobyexample.com/sorting-by-functions In a few other languages: // C++ sort(vs.begin(), vs.end(), [](const string& l, const string& r) -> bool { return l.size() When they fix this, Go might be the perfect language for me. Until then, I'm not touch…
Re: Go by Example
#65This documentation is great, but one thing I tend to miss with examples like these is how to structure a project, deal with packages, etc.
"How to Write Go Code" shows you this, and is a good read: http://golang.org/doc/code.html
- Eggs should not be washed.
Re: Go by Example
#66The documentation format is a revolution of simplicity and comprehension. I can see this list format (and content) working for any/all languages.
Re: Go by Example
#67Re: Go by Example
#68Earlier quoted context omitted.
A few extra lines for sorting means you won't touch Go with a pole? That's a bit extreme. Do you really do custom sorting so often that this is a major problem? There's plenty of other ways in which Go is shorter than the equivalent C++ (e.g. with type inference, or channel operations), but no-one's trying to claim that the shortest code wins.
> A few extra lines for sorting It's not just sorting, it's any parametric polymorphism: generic operations or non-built-in containers (not just in the sense of "array", an atomic ref is also a container) for instance. Go only lets do these in verbose, clunky ways, and losing much of the type safety Go is supposed to provide (what with being a statically typed language) > no-one's trying to claim that the shortest co…
What else could it be? I guess it's a little clunkier, and it's true that writing generic containers in Go isn't so great, but is that sufficient to elicit a reaction of "I'm not touching it with a pole"? Nobody claims it's perfect, but is it really sufficiently horrible to warrant that?
Re: Go by Example
#69Earlier quoted context omitted.
One nice thing these examples also do is make it really simple for detractors to point out what they don't like about it. My #1 gripe about go, for example, is this: https://gobyexample.com/sorting-by-functions In a few other languages: // C++ sort(vs.begin(), vs.end(), [](const string& l, const string& r) -> bool { return l.size() When they fix this, Go might be the perfect language for me. Until then, I'm not touch…
You do realize that go has lambda expressions (anonymous, in-line, functions) right?
Re: Go by Example
#70It's Friday gents! No excuse to set aside Saturday and Sunday, you can easily go through these examples in two days and grok it. Go is that _slim_, and that's good! Guaranteed you'll find use for Go in one system or the other when you want easy deployment, fast development time and extreme speeds. :) (Disclaimer: I love Go and I hope it goes mainstream in a big way in 5 years)
One nice thing these examples also do is make it really simple for detractors to point out what they don't like about it. My #1 gripe about go, for example, is this: https://gobyexample.com/sorting-by-functions In a few other languages: // C++ sort(vs.begin(), vs.end(), [](const string& l, const string& r) -> bool { return l.size() When they fix this, Go might be the perfect language for me. Until then, I'm not touch…