3 ms·
I am a rare (for Hacker News) C# dev and I've just been toying around with Go. There is stuff to like but my feeling is that the biggest weakness of the langua
by joshuaellinger 12y ago
I am a rare (for Hacker News) C# dev and I've just been toying around with Go. There is stuff to like but my feeling is that the biggest weakness of the language is that it is designed to solve the problems that Google has (surprise), which is only a fraction of the problems that the world has.
It is a scalpel verses a swiss-army knife. The question is which do you need.
If you are doing Internet-related things (server-side plumbing and apps, not search), it looks like a pretty darn good fit. It naturally leads you build up a set of small start tools that you combine to build a larger service. The channels metaphor is a really nice way to deal with concurrency.
If you are building anything else (desktop, LOB apps, DB front-ends, mathy stuff, etc.), it looks a bit limited. For example, it doesn't have a modulus operator. Not a big deal but it shows that the language designers are more concerned about supporting their target domain than supplanting Java, much less C#.
Really, the thing that I fine the most troublesome is this feeling that the designers of the language have such a focused vision that it will hinder the growth in the future but, for now, it needs that to keep from becoming overgrown like C# is.
- cookiemonster11 12y agogo uses % for mod (see: http://golang.org/ref/spec#Operators http://golang.org/ref/spec#Operators)
- dyoo1979 12y agoAbout the modulus operator comment; I do not understand what you mean yet. Can you elaborate? For example: http://play.golang.org/p/0AnTQXlR8E http://play.golang.org/p/0AnTQXlR8E appears to demonstrate the operator, unless you mean something different? It is documented as the "remainder" operator in http://golang.org/ref/spec#Arithmetic_operators http://golang.org/ref/spec#Arithmetic_operators
- touristtam 12y agoModulus Operator? Like the following: http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx? If this is the case, maybe you should check the doc: http://golang.org/ref/spec#Arithmetic_operators http://golang.org/ref/spec#Arithmetic_operators try this: http://play.golang.org/p/WA0vX7zmNb http://play.golang.org/p/WA0vX7zmNb I'll leave a copy of the code so you can try it locally as well (and in case the link to play.golang.org breaks) package main import "fmt" func main() { a := 47 b := 6 c := a % b fmt.Println("input: ", a, b) fmt.Println("output: ", c) } [edit]: someone beat me to it :/
- minaandrawos 12y agoI came across this post recently authored by a seasoned .NET developer that outlined why the author preferred Go over .NET: http://blog.jonathanoliver.com/why-i-left-dot-net/ http://blog.jonathanoliver.com/why-i-left-dot-net/