gobol: a console based chat application that I wrote as my first Go project.

blov · · 525 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p><a href="https://github.com/hazrmard/gobol">Link to gobol</a> </p> <p>I started learning Go at the beginning of this month. Go is not my first programming language. Naturally, I couldn&#39;t go through all the &#34;Hello World&#34; examples in <a href="https://tour.golang.org/">A Tour of Go</a>. But having an idea for something to make really helped me. Instead of having all the knowledge beforehand, I started with the fundamentals. I was able to incrementally build up my vocabulary as I worked on my project. </p> <p>So, as someone freshly on the other side of the initial learning curve, that&#39;d be my advice to newcomers: get a project to invest yourselves in. Then you&#39;ll <em>want</em> to stay up late and plough through all sorts of documentation to implement that one little feature you want. </p> <p>Frankly, I was skeptical of Go at first. But having worked with Go&#39;s built-in concurrency and production-ready servers - I don&#39;t want to look back. </p> <p><strong>Some resources I found helpful for quick testing/reference:</strong> </p> <ul> <li><a href="https://play.golang.org">Go playground</a><br/></li> <li><a href="https://gobyexample.com">Go by example</a></li> </ul> <hr/>**评论:**<br/><br/>sethammons: <pre><p>Glad you had fun and wrote something to help you get familiar with Go. A project is always a great way to learn a new language. That said, you couldn&#39;t go through the tour? It is not some academic course; I think I went through it originally in like an hour or something trivial. It is just a tour and gives you an idea of some basics for interaction with Go. <em>Shrug</em></p></pre>HazrMard: <pre><p>I did not go through the entirety of the tour. But I did go through the basics. I found that without a context to apply all the concepts, I just forgot them after a while. So after the first couple of sections, I went to work on my project. I visited the remainder of the tour through google searches etc. as I looked for solutions.</p></pre>radovskyb: <pre><p>Hey there. Good to see you are enjoying Go... It really is fun and awesome to program with!</p> <p>I&#39;ve only skimmed over the <code>server.go</code> file for a quick peek so I haven&#39;t really read the code entirely or properly, but the one thing that really stuck out to me pretty quickly was the amount of errors handling that you&#39;re ignoring in your code. In general you should always be handling all errors, especially here where a lot of the errors that aren&#39;t being handled are errors that could potentially ruin the workflow of the program, for example creating your net listeners or reading from a connection.</p> <p>One other tiny thing is that with http.Serve, if you are only going to be using the http.DefaultServeMux as it&#39;s handler, I would recommend leaving the handler parameter as nil. Here&#39;s a line from it&#39;s documentation: <code>Handler is typically nil, in which case the DefaultServeMux is used.</code></p> <p>Otherwise, nice job for a first program :)</p></pre>HazrMard: <pre><p>Thanks for the feedback. I&#39;m definitely going to look into error handling. I haven&#39;t done much reading on that - I&#39;m going to do that soon.</p></pre>radovskyb: <pre><p>Anytime! If you are ever looking for any more specific feedback for this or anything else you can always ask myself or just ask a question on here and people are usually more than happy to help, but either way, I do think writing programs is one of the best ways to learn anyway :)</p> <p>Just so you know, there is also the Go forum (<a href="https://forum.golangbridge.org/" rel="nofollow">https://forum.golangbridge.org/</a>) and also the Gophers Slack channel (<a href="https://invite.slack.golangbridge.org/" rel="nofollow">https://invite.slack.golangbridge.org/</a>), which are both great resources for asking questions and learning!</p></pre>

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

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