Is programming in Go harder than Ruby?

blov · · 174 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello everyone. I&#39;m looking to learn to code as a hobby, so I&#39;d like to get into a language that isn&#39;t too hard to understand for a beginner. I already studied the basics of Go, but I am very confused on Methods and Interfaces, it seems to me that the concept of Classes makes code easier to understand, so I&#39;m thinking of learning a language that uses that. I&#39;m thinking of trying with Ruby but I wouldn&#39;t like to find out that it is just as hard or more than Go. I&#39;d appreciate if anyone could tell me the difference between the two languages.</p> <hr/>**评论:**<br/><br/>brianvoe: <pre><p>Absolutely not! Go is really easy to program in.</p></pre>Veonik: <pre><p>Ruby is great! I personally think Ruby is much more complex than Go (modules, eigenclasses, dynamic strongly typed, version differences, psuedo-private members, etc) but both are excellent choices for someone new to the scene and doing stuff for fun.</p> <p>Both languages will get you up and running quickly, and productive shortly after. Neither will preclude you from trying out the other.</p> <p>My advice to you would be to pick not one, but try both! For example, build yourself the defacto-example-project todoapp (see: <a href="" rel="nofollow">here for Go</a>, <a href="" rel="nofollow">here for Ruby</a>) in both languages. Once you struggle past the initial weirdness (in either language) you&#39;ll be in a great position to decide which language you want to continue on with, or even to continue with both!</p></pre>onedeveloper: <pre><p>Althought the OP asked specifically about ruby, I think is worth mentioning that Python is very easy to learn, has a great community and because is more popular than ruby easier to find answers to problems/questions.</p></pre>arp242: <pre><p>I&#39;ve always felt that Python and Go are quite similar in their approach to programming and design philosophy, even though it&#39;s obviously a very different language.</p> <p>&#34;The Zen of Python&#34; applies equally well to Go and its community:</p> <blockquote> <p>Beautiful is better than ugly.<br/> Explicit is better than implicit.<br/> Simple is better than complex.<br/> Complex is better than complicated.<br/> Flat is better than nested.<br/> Sparse is better than dense.<br/> Readability counts.<br/> Special cases aren&#39;t special enough to break the rules.<br/> Although practicality beats purity.<br/> Errors should never pass silently.<br/> Unless explicitly silenced.<br/> In the face of ambiguity, refuse the temptation to guess.<br/> There should be one-- and preferably only one --obvious way to do it.<br/> Although that way may not be obvious at first unless you&#39;re Dutch.<br/> Now is better than never.<br/> Although never is often better than <em>right</em> now.<br/> If the implementation is hard to explain, it&#39;s a bad idea.<br/> If the implementation is easy to explain, it may be a good idea.<br/> Namespaces are one honking great idea -- let&#39;s do more of those! </p> </blockquote> <p>That being said, I like Ruby as well.</p></pre>TriflingEuphoria: <pre><p>Since I picked up Go, at around 1.1, I&#39;ve felt that it obeys the Zen of Python better than Python.</p></pre>media_guru: <pre><p>I&#39;ve personally found Python to be one of the more toxic communities (Ruby is right there with it). I&#39;ve never had so many folks tell me &#34;coding shouldn&#39;t be enjoyable&#34; in my life.</p></pre>mightyroger: <pre><p>I&#39;ll second that, the python community is hostile to everything that can be seen as a critique to the language</p></pre>onedeveloper: <pre><p>I&#39;m sorry that has been your experience. Maybe i was lucky finding a really good community local to where i live. PyCon has been held here a couple of times and my impression was that the global community is very inclusive and supportive.</p></pre>christomich: <pre><p>I think it depends on your intentions. If this is for fun then I think you need to base it upon whatever you feel the most comfortable with. If this is for work then choose whatever is of the greatest use for you.</p> <p>On the question of whether one is more difficult than the other, this is unfortunately a bit of a &#34;grenade question&#34; as I don&#39;t believe there is an objective answer. On one hand, Go has concepts like pointers that are easy for some but, from my observations, seems to be difficult for most. The positive for Go is that it doesn&#39;t have as many conceptual constructs to learn that many other languages are burdened with.</p> <p>All in all, my personal advice is not to choose the language based upon a externally based subjective difficulty measure but on whatever you feel the most comfortable learning and your needs.</p></pre>i_need_bourbon: <pre><p>Getting off the ground will be faster with ruby. There&#39;s just so much more material out there.</p> <p>Actually learning Ruby will be harder, simply because there&#39;s so much more to learn, and so many different ways to do just about anything.</p> <p>I think you&#39;ll end up learning faster with Go because it&#39;s very opinionated (well, all the tools are) and will prompt you to fix simple things you&#39;d waste time tracking down in ruby (hail compiler!).</p> <p>So, there are tradoffs.</p> <p>Source: I write both on a daily basis (and javascript).</p></pre>ptdave: <pre><p>It&#39;s more of the right tool for the right job. If you want great performance, then I would say go with golang. Most compiled languages will going to be good for this. If that&#39;s not a key thing for you, then any interpreted language is for you.</p></pre>pinpinbo: <pre><p>I think they are both equally easy to learn.</p> <p>Just pace yourselves, manage your time, and who knows maybe you get to learn both.</p></pre>Streamweaver66: <pre><p>I don&#39;t think so but it depends on what you mean by harder. In terms of the language itself, I think go is more explicit and overall an easier language. Ruby has WAY more libraries and support around it, so the environment is easier.</p></pre>media_guru: <pre><p>I think there&#39;s merit to learning both -- particularly to get experience with dynamic vs. compiled languages. The trend that I&#39;ve observed is that many folks that knew ruby before go ended up loving go.</p> <p>As much as of a Go advocate I am, I would recommend getting your feet wet with Ruby - understanding it&#39;s pros and cons. Learn some of it&#39;s popular frameworks and why they feel necessary. Then switch to Go. Try not to bring many (if any) &#39;practices&#39; you learned from your Ruby development with you to Go. Try to start with a fresh and clear mind, but appreciate the differences. Also, experiment with the Go stdlib as much as possible before leaping for frameworks.</p></pre>metamatic: <pre><p>Go and Ruby are my two favorite languages.</p> <p>If you want to learn OO and end your confusion about methods and interfaces, Ruby will be a better choice. It has a more conventional pure OO style based on the original Smalltalk model.</p></pre>bluexavi: <pre><p>The two languages offer different things to a new programmer.</p> <p>Golang has opinions on how things should be done. Go is less complex and is more opinionated. This makes it much easier to read after you get past a few things that are peculiar to the language (error handling, method signatures, interfaces, channels, etc...)</p> <p>Ruby has a way to do everything for the coder. Tons of third party libraries that can change the look of the language itself. If you want to get from here to there quickest, someone has probably carved a path and distributed it as a gem -- it just might not look like Ruby when in use.</p> <p>Because of this I find the two languages to be very complementary.</p> <p>If you are serious about learning to code I would suggest Go. It is an excellent example of a C like language with some modern niceties and an excellent standard library.</p> <p>If you just want to sling code and see what you can make <em>right now</em>, you can&#39;t do much better than Ruby (and rails) for web applications. Just be prepared that you may need to unlearn/relearn some habits as the language and libraries change around on you.</p> <p>tldnr; Golang if you want to learn programming. Ruby if you want the most programming with the least learning (good thing!).</p></pre>dilap: <pre><p>I suspect it would be easier to learn than Ruby or Python, because it&#39;s a much simpler language, with an easier-to-explain execution model. I also think static types will probably make it easier for a beginner to follow what&#39;s going on.</p> <p>Have you tried reading any of the official Go docs? I think they do a good job of explaining structs, methods, and interfaces. If you have concrete questions, I&#39;m happy to answer them.</p></pre>Witless-One: <pre><p>I think learning go would be more educational and useful if you are just getting started programming. Ruby has some really weird and quirky stuff that will be kind of distracting</p></pre>cheesechoker: <pre><p>Forget it, it&#39;s NP-Hard.</p></pre>ChristophBerger: <pre><p>No, it&#39;s just NP. You can learn both languages in polynomial time. ;)</p></pre>

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

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