<p>So I am quite interested in Go but can someone explain what it's actually used for? Strengths and weaknesses? And what's the deal with interfaces and does it support OOP? As for me I have an understanding of Java, Python and very basic PHP. I'm interested in compiled languages and Go seems like an easier fit to start than C or C++.</p>
<hr/>**评论:**<br/><br/>drvd: <pre><p>Take the Tour of Go <a href="http://tour.golang.org/">http://tour.golang.org/</a> and read the official FAQ <a href="https://golang.org/doc/faq">https://golang.org/doc/faq</a></p></pre>postman_: <pre><blockquote>
<p>what it's actually used for?</p>
</blockquote>
<p>Its main area of usage is web services.</p>
<blockquote>
<p>Strengths and weaknesses?</p>
</blockquote>
<p>Strengths: compilation to native code, static type checks, N:M coroutine scheduler built into runtime with rich abstractions, such as goroutines and channels, garbage collection, mature standard library.</p>
<p>Weaknesses: dumb type system, tedious error checking, no standard on dependency management.</p>
<blockquote>
<p>And what's the deal with interfaces and does it support OOP?</p>
</blockquote>
<p>Interfaces are a form of polymorphism chosen by Go. Whether it supports OOP depends on your definition of OOP.</p>
<blockquote>
<p>I'm interested in compiled languages and Go seems like an easier fit to start than C or C++.</p>
</blockquote>
<p>It's certainly easier but I'd urge you to learn C later anyway.</p></pre>flippynipz: <pre><p>Exemplary answer point by point thanks! But for OOP i mean structured like Java or even Python. Define class, set variables, constructors,define methods etc.</p></pre>YEPHENAS: <pre><p>You can define data structures with fields and you can define methods on these data structures. There are no constructors, but you can write functions that create and initialize instances of data structures, but you often don't need them. There's no inheritance, but you can embed other data structures into a data structure and have their methods promoted to the level of the outer structure. Interfaces provide polymorphism. They are satisfied implicitly: If a type has all the methods of an interface then the interface is considered implemented by the type. You do not have to declare explicitly "X implements Y".</p></pre>flippynipz: <pre><p>Ahh alright. Thanks for the amazing answers.</p></pre>-Nii-: <pre><blockquote>
<p>methods promoted to the outer level </p>
</blockquote>
<p>This is new to me. What is this called, so that I may read further information on it?</p></pre>theag3nt: <pre><p>Unfortunately I don't know if there is a separate name for the promotion of methods, but you can find out more about anonymous/embedded fields in the language specification:<br/>
<a href="https://golang.org/ref/spec#Struct_types" rel="nofollow">https://golang.org/ref/spec#Struct_types</a></p></pre>srbufi: <pre><blockquote>
<p>dumb type system</p>
</blockquote>
<p>Could you explain further, please?</p></pre>postman_: <pre><p>The most frequent complaint is the absense of generics. There are others, less frequent, such as questionable nature of multiple returns and nonvariance of the array type constructor.</p></pre>