Go by Example
71–80 of 130 posts
Re: Go by Example
#72Earlier quoted context omitted.
Go does not have a lot of new features, but mostly a specific collection of convenient ones (static compilation, GC, etc.) Not sure how many new languages have truly new features, vs. how many are improvements in productivity (human and machine). My point is that generics are not a new idea either, and plenty of languages offer them. Go is not meant (anymore) to replace C/C++/Java or even Rust. It will never have all…
> But it seems impossible to have a HN discussion on Golang without part of the thread getting hijacked with "But generics!!!" Surely the exact same criticism could be leveraged at go proponents pointing out the exact same features they love every time, should discussions of Go simply stop until the next major release, and only new features (if any) be discussable?
Re: Go by Example
#73It'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
#74Re: Go by Example
#75It'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)
Although no one seems to have this problem, golang (easier to google "golang" than "go") doesn't suffer from #ifndef guard problem which can make your large C++ app take hours to build http://talks.golang.org/2012/splash.slide#18 . I mean if it were written in go it wouldn't take hours to build, and it would be clear which includes you really need. But people with large C++ code bases are probably--hey they have plen…
Turbo Pascal 5.5 was compiling 34,000 lines/minute in 1989 in MS-DOS systems!
http://edn.embarcadero.com/article/20803
Compared with module based languages, C and C++ toolchains have been always slower.
Re: Go by Example
#76Earlier 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…
This article's for you. http://go.c800colon5.com/blog/2014/01/09/a-grumpy-guy-compla...
Re: Go by Example
#77It'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
#78Earlier quoted context omitted.
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…
If only there were a workaround for not having generics, sigh. But seriously, they may not implement generics out of spite or just to troll generics zealots. Edit: remove ambiguity
now my code looks like "func map(x []T, f func(T) T)" and everybody's happy :)
Re: Go by Example
#79Earlier quoted context omitted.
Not having generics reduces explicitness (because you don't specify the types of your containers) and reduces safety (because of all the casts and manual implementations of things like swap functions).
On the other hand, C++ templates sometimes make it hard to understand which function ends up getting called, what size a particular type actually has or what is an alias for what. There are too many indirections to follow manually. All I know is that the compiler will select some function that has conforming types. The compiler is very very smart. It knows all the incredibly complicated name resolution rules and it w…
Re: Go by Example
#80Earlier quoted context omitted.
I don't consider the features (or lack thereof) to be nitpicks. They are valid criticisms, but they have had their own very extensive discussions, and we are all very aware of them. Bringing that into a thread regarding a very cool set of examples regarding the core features of the language, isn't very constructive (at least IMO).
Ah. I see where our disagreement comes from. I do not believe that everyone is very aware of these issues. I believe go users are, but since this entire thread is evangelistic, there are people here who are not currently go users who are not aware. The exclamations of surprise at my provided example are proof enough of this for my satisfaction.