The wisdom of Elixir, for new Gophers

blov · · 496 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>The following text (adapted) is copied straight from the introduction to Elixir. </p> <p>&#34;Instead of asking “how to do X in {Elixir | Go}”, ask “how to solve Y in {Elixir | Go}”. In other words, don’t ask how to implement a particular solution, instead describe the problem at hand. Stating the problem gives more context and less bias for a correct answer.&#34;</p> <p>I only wanted to share this to say, that instead of bringing solutions, patterns and technique from other languages and platforms, it is useful to think about the problem and how to solve it in idiomatic Go (or any other language). </p> <p>I&#39;ve been writing C# since the beta first came out, and I&#39;ve been doing Go for a few years now, and I still have to fight the tendency to think &#34;I need x feature from C#, or I&#39;d structure it this way&#34; instead of how to do it in Go. Go has set of strengths (composition, interfaces, duck typing, channels, goroutines, containment, no inheritance, embedding, garbage collection, simplicity, clarity), other languages have other strengths (functional constructs, generics, built in DSL&#39;s), some languages like C# have a bit of everything. What is true for Elixir, Go, C#, Rust, etc, is that they can solve most real world problems, but the solution to each doesn&#39;t take the same shape, and shouldn&#39;t need to, because then you aren&#39;t taking advantages of the strengths of the language.</p> <hr/>**评论:**<br/><br/>jerf: <pre><p><a href="http://catb.org/%7Eesr/faqs/smart-questions.html">How to Ask Questions</a>. It&#39;s generally good stuff, and if perhaps some of it rubs you the wrong way, well... to some extent that may be because you are the one who needs to be reading the document. :)</p> <p>I&#39;ve actually been relatively pleased with at least the people posting on <a href="/r/golang">/r/golang</a>; there&#39;s a lot of &#34;how do I do {{ .highLevelGoal }}&#34; here, and a good amount of posting of real code, and not a lot of the typical &#34;how do I do this small part of the crazy plan I&#39;m not telling you about where in fact there&#39;s an easier way to do the whole thing that you can&#39;t guess because my question is too specific?&#34;</p></pre>lluad: <pre><p><a href="http://xyproblem.info/">xyproblem.info</a> is a useful link to remember when explaining this to people.</p></pre>

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

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