Is go a suitable first language for young people to learn?

xuanbao · · 796 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I want to teach some pre-teens and teen programming. I have been casting around for what language to teach them like Python or Javascript but personally I can&#39;t stand either of those languages. I do like Ruby but the ecosystem is complex to set up. I suppose there are things like Racket but I don&#39;t think they are practical enough to entice them.</p> <p>Is go a good candidate or does it kind of presume you are already familiar with programming in general</p> <hr/>**评论:**<br/><br/>david5813: <pre><p>I am currently teaching a handful of early teens and pre-teens programming. I have chosen to start them on Javascript because combined with HTML/CSS they are able to have the immediacy of creating something very useful to themselves and others. I told all of them initially that there are far more details of programming that they can see at the moment. My current approach is that:</p> <ol> <li>I will teach them how to build things</li> <li>I&#39;ll teach them how to run it (basically an intro to being a sysadmin)</li> <li>I&#39;ll teach them how to break it</li> <li>After the first three steps we will go further in-depth in the areas that they find the most interesting.</li> </ol> <p>I personally think that golang would be just find to start with as long as their attention spans and personal ambition is strong enough to overcome the initial slower pace.</p></pre>BasicDesignAdvice: <pre><p>I&#39;ve alway&#39;s loved JS for exactly this. It&#39;s not a great language, but it is so accessible and easy to share.</p></pre>Rabiesalad: <pre><p>Google Apps Script also uses Javascript syntax so if they want to leverage powerful stuff in Google Drive and other things in the Google ecosystem, it&#39;s great!</p></pre>xiegeo: <pre><p>How did you go from html to sysadmin?</p></pre>konrain: <pre><p>For the love of god, dont teach them Ruby.</p> <p>You can definitely teach them go. Go is a very straight forward language. The first language I learned was C. Just start them off slowly to get the concept of what a Variable, String, Array, Function ect.. and how the computer changes the stuff you write into binary 0&#39;s and 1&#39;s using a compiler. This stuff will be the same in every language.</p></pre>BasicDesignAdvice: <pre><p>What if they live in San Francisco?</p></pre>PaluMacil: <pre><p>I think you&#39;ll run into enough pros and cons for any language that you&#39;ll do fine with most languages. The tradeoff between Ruby, Python, JavaScript vs C, C++, and Go is that the former teaches less of the tricky concepts that help so much (arrays, pointers, etc), but perhaps they&#39;d become productive faster with those ones, which would encourage them to keep going. If you look at job potential, a new dev with C probably won&#39;t find a job since a company looking for a C developer is probably tackling a very difficult problem. JavaScript probably translates to the easiest to find job for a new dev, but it&#39;s also the worst at teaching good programming. I think the only strong statement I&#39;d make is to favor Python over Ruby. Both have very similar sets of pros and cons, but there are a few times more jobs in Python, and that&#39;s especially true if you&#39;re not living on the coasts.Go would be tricky conceptually for someone who hasn&#39;t coded, but it&#39;s clean and very simple in terms of specification, so it could be a great place to learn. Finding a job might not be easy in all cities, but the dev would also know enough complex topics to get easily into another language.</p></pre>thefryscorer: <pre><p>I think for teenagers being able to create something fun early on is pretty important. Python is good for this because of libraries such as Pygame and (for younger students) Turtle. It&#39;s also good as a starting language because when they learn the basics they could actually use it for things that they might actually want to do, using Minecraft and RaspberryPi libraries. </p> <p>Go is a younger language, and I&#39;m not aware of many libraries that could get young kids to start playing around with it beyond making command line apps, which I suspect they don&#39;t really see much point in. </p> <p>That being said, I believe Go could be beginner friendly with the right instruction. Input and output would be harder to teach than in python, though. Python&#39;s input() and print() are simple, but powerful enough for most things a beginner would want to do. I&#39;d rather teach young students </p> <pre><code>i = int(input(&#34;Number: &#34;)) </code></pre> <p>than</p> <pre><code>var i int fmt.Print(&#34;Number: &#34;) fmt.Scan(&amp;i) </code></pre> <p>But, if you think you can make it &#34;fun&#34; or at least engaging early on, I don&#39;t see the language itself being too difficult to start with, but not as simple as Python might be.</p></pre>thewhitetulip: <pre><p>Also Go is heavily (and correctly) opinionated . Python is great for starters, once you are comfortable in Python Go is a great language for building webapps and APIs</p></pre>thefryscorer: <pre><p>I would argue that, depending on what you mean by &#34;opinionated&#34;, that is a plus for Go. I&#39;ve spent the past few weeks helping to tutor teenagers in Python and honestly Python is way too permissive. I&#39;ve had a few students in the last week have code that <em>technically</em> works, but only co-incidentally, and it&#39;s clear they don&#39;t actually understand what it means. Like, one student writing</p> <pre><code>elif word[-1]: </code></pre> <p>when really they wanted an else statement. But that happens to work because Python will evaluate a character as True. </p> <p>But Go on the other hand? Nope, if you use an if, you need a bool. </p> <p>Student creates a variable but forgets to use it, causing their code to be incorrect? Doesn&#39;t compile.</p> <p>Students have also been using Python&#39;s &#34;and&#34; and &#34;in&#34; keywords everywhere. I think they think it&#39;s magic and they can type &#34;if x in y:&#34; for any x and y and it&#39;ll work out what they want. And for some things, this works, obviously. But then you see them go and do </p> <pre><code>if &#39;2&#39; in x: </code></pre> <p>to check if a number is even.</p> <p>But then, as far as I know, Go doesn&#39;t even have a beginner friendly means of checking if an element is in a list. </p> <p>I&#39;ve been thinking about this a lot over the past weeks. I still don&#39;t think Go is better suited to beginners than Python is. But I do wish Python was less easy for students to shoot themselves in the feet with.</p></pre>thewhitetulip: <pre><p>Yes, this is all correct, my apologies if I said it incorrectly.</p> <p>Using Python is like magic, I remembered the days when I switched from C/C++/Java to Python, used in everywhere and stuff. Go doesn&#39;t allow you to do that, it is statically typed, so maybe it&#39;s a good choice to start learning programming, but only if they have a guide like you who knows things, the college I was in, I was the only one knowing Python. Had only the Internet to help me out.</p> <p>Also I do not think it matters which language is the &#34;best&#34; one, programming is about solving problems, choice of language is personal + depending on what problems you solve :)</p> <blockquote> <p>But I do wish Python was less easy for students to shoot themselves in the feet with.</p> </blockquote> <p>This, I agree. Python is easy enough to understand the syntax in a week, but it takes years to be proficient in it.</p></pre>myringotomy: <pre><p>My problems with python is the environment and tooling. Every time I attempt to run a python app on my mac I have to suffer through pyenv and pip incompatibilities and conflicts with the system python etc. Aside from that I just don&#39;t want to deal with explaining significant white space to a kid especially since I am not a fan of it.</p></pre>jinks: <pre><p>You don&#39;t really need to &#34;teach&#34; significant whitespace since you should be teaching proper indentation anyways and the significant whitespace falls out of that naturally.<br/> (<code>go fmt</code> <em>allows</em> you to be sloppy in that regard, but you shouldn&#39;t <em>teach</em> to be sloppy.)</p> <p>As to libraries, just install everything they need globally. Pip and related stuff is good for deployment and isolated work environments / dependency management, but that&#39;s not something teens and preteens should be worrying about.</p> <p>I don&#39;t know how easy it is to do global library installs on mac (brew?). On Linux every marginally popular python library usually comes as a system package.</p></pre>myringotomy: <pre><blockquote> <p>You don&#39;t really need to &#34;teach&#34; significant whitespace since you should be teaching proper indentation anyways and the significant whitespace falls out of that naturally.</p> </blockquote> <p>I disagree. There is no real reason to be that much of a stickler on significant whitespace because most editors will format your code automatically. With python it&#39;s impossible for a beginner to simply cut and paste some snippet in place and make it work. They have to spend time getting the snippet indented properly within the code (paste doesn&#39;t always work as is) and then within the larger program itself. My experience is that beginners are annoyed by this in the &#34;why the fuck do I have to care about this&#34; way.</p> <blockquote> <p>I don&#39;t know how easy it is to do global library installs on mac (brew?). On Linux every marginally popular python library usually comes as a system package.</p> </blockquote> <p>Just yesterday I was installing the aws-cli tools which are written in python. Following the instructions on their website I ran into several problems. One was that somehow the python installed from brew wasn&#39;t working right so I uninstalled it and used the system python instead. Then I ran into another problem because the directory I downloaded it into was inside of a directory hierarchy whose top level was a symlink. So it was </p> <pre><code> ln -s ~/Documents/Google Drive/source ~/Documents/source </code></pre> <p>The python install tools changed the directory to the Google Drive directory and failed because the directory had a space in it. The solution was to to move the source code to a directory without spaces in it&#39;s path and install it from there.</p> <p>Why should a beginner have to put up with crap like that? </p></pre>nyoungman: <pre><p>There are libraries like Gobot, which is similar to Cylon.js. It lets you work with GPIO on the Pi or control Sphero. Since the Pi is pushing Python, it certainly makes it easier.</p> <p>What I like about Go is that it&#39;s a smaller language. I think you can master the whole language in less time, which should bring a great sense of accomplishment.</p></pre>aaaqqq: <pre><p>The things you&#39;d need to learn Go fit in one page so yes, Go is a great language to teach programming. Since you can teach/learn the syntax so quickly, you can start solving problems much sooner and with lesser &#39;language related problems&#39;</p></pre>jfurmankiewicz: <pre><p>Absolutely.</p> <p>Frankly speaking, it&#39;s an excellent choice since they can do real production-grade stuff in it.</p></pre>pinkyabuse: <pre><p>Python might not be your favourite language but it is easy to get going. The thing about Go is that if you want to do something like get the last element of a slice, it&#39;s a bit more technical compared to the Python way. Does that, however, mean that learning Go would provide a deeper learning experience? That&#39;s up for debate. </p> <p>But what I do know is that you don&#39;t want students to be giving up on coding because the language is too difficult. Python is famous for being an easy language to pick up. </p> <p>Plenty of people started off learning coding with C so I think it&#39;s possible that Go would work. Personally, I would use Ruby or Python to introduce coding to adolescents. Even JavaScript might be a good language because of its ubiquity and doing fun graphical stuff in the browser. </p></pre>hipone: <pre><blockquote> <p>I would use Ruby </p> </blockquote> <p>Why?</p></pre>WellAdjustedOutlaw: <pre><p>I got my start with C. So. Go isn&#39;t that much more difficult than Python when doing simple stuff. And understanding more complex topics like pointers, struts, go routines, interfaces, etc...most of that comes down to the teacher and how they help the students relate to it.</p></pre>leeview: <pre><p>How are you going to teach them if you don&#39;t know the answer to this question ? Just teach them what you already know best.</p></pre>metamatic: <pre><p>For the pre-teens I&#39;d actually start with Logo or Scratch, just to get to something interesting and visual in as little time as possible. Another possibility would be Minecraft + ScriptCraft (JavaScript). It&#39;s more important to get their interest than to use a language you would personally do serious software engineering in.</p> <p>I think Go needs a bit too much side-knowledge of things like memory layout, pointers, bit widths and other architectural low-level details of computers. The lack of good cross-platform GUI support could be an issue too. It&#39;d be a good second language though.</p> <p>You could avoid a lot of the ugliness of setting up a working Ruby system by using JRuby, maybe with some <a href="https://github.com/rbedia/tugaturtle" rel="nofollow">turtle graphics</a>. Unfortunately the <a href="http://kidsruby.com/" rel="nofollow">KidsRuby</a> project seems to have stalled.</p></pre>Destructicorn: <pre><p>I do think Ruby would be a good language to start with. I agree that the environmental setup can lead to some issues but if for teaching purposes it&#39;s very controlled it shouldn&#39;t be a problem. Not to bash <a href="/u/metamatic" rel="nofollow">/u/metamatic</a> but depending on what you&#39;re doing, JRuby can be a configuration nightmare.</p> <p>I also don&#39;t seem a reason why Go would be great just depends on how you convey it.</p></pre>metamatic: <pre><p>Well, sure, JRuby can be a nightmare, but it&#39;s easy to get a basic Ruby interpreter running with it, assuming you have a JVM installed. Easier than installing an up-to-date Ruby on OS X, for example.</p></pre>wlll: <pre><blockquote> <p>Easier than installing an up-to-date Ruby on OS X, for example.</p> </blockquote> <p>It&#39;s really not that hard to install a modern Ruby version on OS X anymore. This guide is pretty easy to follow and shouldn&#39;t take very long at all:</p> <p><a href="http://guides.railsgirls.com/install" rel="nofollow">http://guides.railsgirls.com/install</a></p></pre>metamatic: <pre><p>Yes, but that&#39;s still harder than just unpacking a downloaded zip file and updating your path.</p></pre>storm14k: <pre><p>I&#39;ve taught one of my sons about programming off and on using Go. He was in 1st or 2nd grade at the time and the language wasn&#39;t a barrier at all. It allowed me to get right to a lesson without worrying about setup etc that would lose his attention. If we start it up again I will stick with Go for teaching most likely.</p></pre>Rabiesalad: <pre><p>Hell yes, it would be an amazing first language the only confusing part is the initial setup but frankly I think it&#39;s mostly just confusing coming from traditional programming.</p> <p>Once I got over that initial hump, simple programming concepts are incredibly easy to learn via Go and the go playground is really simple, fun, and useful and you can use it to teach simple stuff without having to get into setting up proper editors and stuff.</p> <p>Another major benefit to Go is it includes more modern fundamentals like concurrency and you can really tell it&#39;s designed to be practical for modern applications (web apps and servers etc.)</p></pre>junajted: <pre><p>If I were in a situation like this, I&#39;d choose statically typed language but would prefer Java/C/C++ over Go. It&#39;s mainly because first three are unfortunately still more popular and there are more learning resources written from complete programming beginner POV.</p></pre>thewhitetulip: <pre><p>I am a self taught programmer and I followed this path</p> <ol> <li>css (not exactly a language)</li> <li>html</li> <li>C</li> <li>c++/Java</li> <li>Python</li> <li>Go</li> </ol> <p>The thing is, Go was not created as a generic language, it is built for one goal, to manage codebase with large (possibly distributed) teams. It is a modern language as in problems Google had faced while building the apps for the future.</p> <p>This doesn&#39;t mean one can&#39;t start programming in Go, but it is crucial to understand that Go doesn&#39;t follow the <em>standards</em>, it goes in the totally opposite direction as in it enforces many things which Python/others keep open for the programmer to choose.</p> <p>I&#39;d say better start with Python and then switch to Go.</p></pre>jack747z: <pre><p>I taught the basics of JavaScript when i taught 8th grade Math. It&#39;s generally a wretched language to teach programming in (especially Math) but every student already had everything they needed to program on their laptops, notepad and a browser. j</p></pre>wlll: <pre><blockquote> <p>I do like Ruby but the ecosystem is complex to set up.</p> </blockquote> <p>FWIW at the most recent RailsGirls Manchester we got everyone set up within about an hour (<a href="http://guides.railsgirls.com/install" rel="nofollow">http://guides.railsgirls.com/install</a>) on the Friday evening, then most people had some sort of basic website running on Heroku by the end of the Saturday.</p></pre>SilentWeaponQuietWar: <pre><p>I&#39;d vote for JS too, only because it&#39;s a bit more forgiving and has a wider variety of projects it could be used for. Personally I started programming with Java and C, and I always hated that everything was done via command line. At least with JS it can be done in the browser, and there will be MANY more examples for them to look up on their own.</p> <p>I love go, but not sure it would have clicked with me when I was just learning to program.</p></pre>PHPDevloper: <pre><p>In my experience it&#39;s very difficult and unpleasant to write in anything else after learning Go. So I would not recommend it as a first language.</p></pre>nyoungman: <pre><p>IMO, Go could be a great first programming language. It&#39;s well designed, close enough to the machine that understanding how computers work is part of it, but still easy to use like a scripting language.</p> <p>I&#39;m currently writing a fun book for scripters learning Go, and would love feedback on how to make it more approachable for people new(er) to programming. <a href="https://yng.mn/learngolang" rel="nofollow">https://yng.mn/learngolang</a></p> <p>If you&#39;re interested in providing some feedback, I have a few coupon codes to get the ebook for free. Email me at <a href="mailto:gopher@nathany.com" rel="nofollow">gopher@nathany.com</a> Cheers!</p></pre>Zilog8: <pre><p>IMHO, Go would be a great first language to learn with, as long as you start them off with just the basic features; leave goroutines and sending-values-by-reference for when they are already comfortable with the rest of the language.</p></pre>DrillinOil: <pre><p>I do think Go is a good candidate. For teaching programming concepts and diving into what makes a programming language. However, there are some things you&#39;ll want to consider: What kind of projects will your pupils want to make? Will the installation process be easy enough? Are there &#39;googleable&#39; resources for novice learners?</p> <p>With a language like JavaScript, there is an immediacy to getting tangible results that Go doesn&#39;t have. Want to animate something? Want to share something with a friend that you made? JavaScript lends itself well to this. JavaScript has no real installation process and is pretty much ubiquitous on every platform. The age of the language and huge number of novice programmers coming from pure HTML and CSS means there&#39;s a plethora of &#39;googleable&#39; help out there, even if one doesnt have a rich programming vocabulary to find answers to everyday problems yet.</p> <p>All that said, I believe JavaScript to be a pretty poor language in which to really learn the art of programming instead of just getting something done. Go, on the other hand, is a great language for teaching programming concepts. It can also grow well from a simple hello world to more robust program gracefully. You&#39;ll have the opportunity to discuss types, function, function signatures, pointers, interfaces (in the abstract), composition over inheritance, maps, arrays, functions as values, etc. These concepts provide a solid foundation for exploring other languages. Go fmt helps novice programmers put out readable code (this will help you tremendously). Compiler errors can be frustrating at first, but useful later. &lt;/2cents&gt;</p></pre>myringotomy: <pre><p>I am not fond of Javascript either but as you say it&#39;s easy to get set up and ubiquitous. Seems like no matter what you do you need some javascript.</p></pre>jakob_roman: <pre><p>Small Basic is designed for teaching young people. It&#39;s has online tutorials that take you from square one to being competent, and it has a community where students can share and show off their projects if they want. It&#39;s worth a look.</p> <p><a href="http://smallbasic.com" rel="nofollow">http://smallbasic.com</a></p></pre>myringotomy: <pre><p>Windows only so not really suitable for me.</p></pre>ddmf: <pre><p>It depends how young - my two (under 10) like Minecraft, and python is the go to language there. They are still learning scratch because of the immediacy there.</p> <p>Teens I would say use Go with them as they will probably already have the basics down.</p></pre>tscs37: <pre><p>very yes</p></pre>mcsseifer: <pre><p>A scripting language should not be as first. It is can be c/c++/java. Golang is possible too. Very important for students are to know a basics of computer science such as memory, cpu, pointers, array vs list and etc. The languages with statical types is best choice for this.</p></pre>konrain: <pre><p>Are you trying to drive them away? We have to ease them in and then trap them.</p></pre>metakeule: <pre><p>Why? Must everybody be a programmer? Why not give them realistic feelings about what to expect instead of trapping them into thinking they are great programmers when in reality they have to learn so much more? Until they understand that programming is not for them they already wasted a lot of time.</p></pre>konrain: <pre><blockquote> <p>Why not give them realistic feelings about what to expect instead of trapping them into thinking they are great programmers when in reality they have to learn so much more?</p> </blockquote> <p>You&#39;re not special because your a programmer. You just learn it, They are obviously there because they&#39;re interested. I guarantee you if the first thing you learned was about pointers, closures, or concurrency, you&#39;ve said fuck this.</p></pre>

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

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