What is Golang and what can I do with it as a noob?

xuanbao · · 568 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hey guys, I&#39;m a Sophomore in college with good knowledge of Java, basic knowledge of C++. I&#39;ve created an android project and I&#39;m in an android internship right now. </p> <p>I heard about Golang from a hackathon I went to this weekend and I was wondering what i can do with it. I&#39;ve read a bit about it but it&#39;s still unclear to me.</p> <p>Thanks :)</p> <hr/>**评论:**<br/><br/>knotdjb: <pre><p>Here is a <a href="https://commandcenter.blogspot.com.au/2012/06/less-is-exponentially-more.html">good article</a> about the language design and how it differs to C/C++. However Go stands out from the languages you mentioned by having simple &amp; straightforward constructs to do powerful concurrency. So if you&#39;re writing socket servers or require elaborate synchronization, Go can make this quite natural.</p> <p>I would say its weak (at the moment) in developing GUI and scientific/numerical software. Probably quite a bit more. But if you follow the language enough, it is evolving at a steady pace and <em>carefully</em> tackles its shortcomings rather than doing a half-arsed hackjob.</p></pre>butMED: <pre><p>Got it! Thank you very much, I will take a look at the article. I appreciate your reply.</p></pre>weberc2: <pre><p>Go is a general purpose programming language, so you can do all sorts of things with it (though I don&#39;t think it&#39;s a good candidate language for Android/iOS apps yet). It&#39;s especially good for web backends, where concurrency matters (few languages can compete with Go on concurrency). That said, it&#39;s an easy language to learn--much easier than Java or C++. Head over to <a href="http://tour.golang.org">http://tour.golang.org</a> for some interactive tutorials. I haven&#39;t done the tour in a few years, but you should be able to get through it in an afternoon. Once you&#39;ve done that, you should have a pretty good idea about how the language works--enough to start writing interesting programs. Getting a Go development environment set up is a bit tricky (I have an installation guide <a href="http://weberc2.bitbucket.org/posts/installing-go-on-linux-and-osx.html">here</a>, but I don&#39;t know that it&#39;s very good and others should feel encouraged to recommend additional guides), so feel free to come back and ask questions.</p> <p>Hopefully others can chime in here with some good introductory resources (specifically good links about $GOPATH or good GUI text editors).</p></pre>sh41: <pre><blockquote> <p>Getting a Go development environment set up is a bit tricky</p> </blockquote> <p>I actually think installing Go is the easiest and simplest experience I&#39;ve seen yet. Do you know of other languages you&#39;d consider to be less tricky than Go? I&#39;d like to look into them and compare.</p></pre>slimsag: <pre><p>FWIW I consider Rust to be just as easy, and <em>maybe</em> even easier to set up because it has no concept of GOPATH / a central project directory. (P.S. hi :) )</p> <p>Also, even easier if you use the <code>rustup.sh</code> install script available at <a href="https://www.rust-lang.org/en-US/downloads.html">https://www.rust-lang.org/en-US/downloads.html</a></p></pre>sh41: <pre><p>Thanks, I will be curious to check it out and see if I can gather any insight from it then. And hi. :)</p></pre>weberc2: <pre><p>Go is easier than every language I know, but I still had a hard time getting up and running. Specifically pertaining to GOPATH and project directory structure.</p></pre>hoffentlich: <pre><p>That just means you don&#39;t have simple knowledge of how a shell works. If adding two shell variables means &#34;tricky&#34;, then I don&#39;t know what else to say.</p></pre>weberc2: <pre><p>I just checked your comment history. Please don&#39;t troll here.</p></pre>hoffentlich: <pre><p>Trolling or not, it has nothing to do with this thread and it doesn&#39;t change the fact that what I said is obvious. </p></pre>: <pre><p>[deleted]</p></pre>sh41: <pre><p>I think it&#39;s simple and clear. How can Go know where you&#39;d like to store your personal code? Setting a single env var to tell it that seems very reasonable.</p> <p>I suppose it having a default sensible location if GOPATH is unset would be okay too. Then, if you&#39;re happy with the default, no need to set GOPATH, and if you want to change it, you can.</p> <p>The downside of that is if you accidentally run <code>go</code> with that env var not set, it&#39;ll potentially start looking in the wrong folder and give you weird/unexpected results, instead of just a clear error.</p> <p>(There is a <a href="https://github.com/golang/go/issues/12488" rel="nofollow">proposal</a> about this or something related to this.)</p></pre>: <pre><p>[deleted]</p></pre>sh41: <pre><blockquote> <p>If you&#39;re doing serious work you&#39;re going to start setting those different on per project basis anyway.</p> </blockquote> <p>Go uses workspaces, not projects. It&#39;s a different approach.</p> <p>You can do things differently, but it&#39;s not neccessary and often not helpful.</p> <p>What are the default locations for Python, Node, Rust?</p></pre>butMED: <pre><p>Thank you very much! I&#39;ll head over there and try to learn the syntax. I will also check out the installation guide. I really appreciate the help.</p></pre>weberc2: <pre><p>No problem. Feel free to come back to this sub (or PM me) whenever you get stuck; we&#39;ll get you moving again quickly.</p></pre>thewhitetulip: <pre><p>If you want to explore the world of writing webapps, read my book :-)</p> <p>It is a practical based tutorial on how to write webapps in Go without a framework and assumes 0 knowledge about how to write webapps .</p> <p><a href="https://github.com/thewhitetulip/web-dev-golang-anti-textbook/">https://github.com/thewhitetulip/web-dev-golang-anti-textbook/</a></p></pre>butMED: <pre><p>Just downloaded the PDF. I love the formatting, will definitely be reading through this for reference.</p></pre>thewhitetulip: <pre><p>Thanks! Which PDF? there are two, leanpub.com and one from gitbooks.com</p> <p>I love the leanpub one!</p></pre>bitmadness: <pre><p>Step 1: Have some self-confidence and don&#39;t think of yourself as a noob, noob.</p></pre>butMED: <pre><p>Hahahaha okay okay I&#39;ll try not to :)</p></pre>saeijou: <pre><p>it&#39;s a good question, i looked a bit into go as well and I was wondering, if and how i could write programs for windows</p> <p>is that easy with go, or should i look into something different?</p></pre>arschles: <pre><p>You can write programs in Go and compile them for Windows, but they&#39;ll likely be for the command line. If you&#39;re looking to build GUI apps for Windows in Go, there&#39;s a pretty good list at <a href="https://github.com/avelino/awesome-go#gui" rel="nofollow">https://github.com/avelino/awesome-go#gui</a> for GUI toolkits in Go. </p> <p>I&#39;ve never tried any of them, but <a href="https://github.com/lxn/walk" rel="nofollow">https://github.com/lxn/walk</a> seems to be specifically targeted for windows.</p> <p>Good luck!</p></pre>saeijou: <pre><p>awesome, thank you so much!</p></pre>bigpigfoot: <pre><p>I&#39;m gonna compare your question to &#34;What is Java and what can I do with it as a noob?&#34; and say Go excels at high performance web applications and its standard library allows you to do pretty much everything you&#39;d want to including cross platform compilation, writing any kind of applications (except ones with GUIs as Go doesn&#39;t really have a GUI library – you have a web browser for that).</p></pre>brokedown: <pre><p>It is a programming language and you can use it to write programs. For more info, see golang.org.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

568 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传