<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'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'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'll teach them how to run it (basically an intro to being a sysadmin)</li>
<li>I'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've alway's loved JS for exactly this. It'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'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's and 1'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'll run into enough pros and cons for any language that you'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'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'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's also the worst at teaching good programming. I think the only strong statement I'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's especially true if you're not living on the coasts.Go would be tricky conceptually for someone who hasn't coded, but it'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'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'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'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's input() and print() are simple, but powerful enough for most things a beginner would want to do. I'd rather teach young students </p>
<pre><code>i = int(input("Number: "))
</code></pre>
<p>than</p>
<pre><code>var i int
fmt.Print("Number: ")
fmt.Scan(&i)
</code></pre>
<p>But, if you think you can make it "fun" or at least engaging early on, I don'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 "opinionated", that is a plus for Go. I've spent the past few weeks helping to tutor teenagers in Python and honestly Python is way too permissive. I've had a few students in the last week have code that <em>technically</em> works, but only co-incidentally, and it's clear they don'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't compile.</p>
<p>Students have also been using Python's "and" and "in" keywords everywhere. I think they think it's magic and they can type "if x in y:" for any x and y and it'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 '2' in x:
</code></pre>
<p>to check if a number is even.</p>
<p>But then, as far as I know, Go doesn't even have a beginner friendly means of checking if an element is in a list. </p>
<p>I've been thinking about this a lot over the past weeks. I still don'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't allow you to do that, it is statically typed, so maybe it'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 "best" 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'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't really need to "teach" 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'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's not something teens and preteens should be worrying about.</p>
<p>I don'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't really need to "teach" 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'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't always work as is) and then within the larger program itself. My experience is that beginners are annoyed by this in the "why the fuck do I have to care about this" way.</p>
<blockquote>
<p>I don'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'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'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'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'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 'language related problems'</p></pre>jfurmankiewicz: <pre><p>Absolutely.</p>
<p>Frankly speaking, it'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's a bit more technical compared to the Python way. Does that, however, mean that learning Go would provide a deeper learning experience? That's up for debate. </p>
<p>But what I do know is that you don'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'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'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'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'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'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'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's very controlled it shouldn't be a problem. Not to bash <a href="/u/metamatic" rel="nofollow">/u/metamatic</a> but depending on what you're doing, JRuby can be a configuration nightmare.</p>
<p>I also don'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'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's really not that hard to install a modern Ruby version on OS X anymore. This guide is pretty easy to follow and shouldn'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's still harder than just unpacking a downloaded zip file and updating your path.</p></pre>storm14k: <pre><p>I'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'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'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'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'd choose statically typed language but would prefer Java/C/C++ over Go. It'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't mean one can't start programming in Go, but it is crucial to understand that Go doesn'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'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'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'd vote for JS too, only because it'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'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'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'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'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'll want to consider: What kind of projects will your pupils want to make? Will the installation process be easy enough? Are there 'googleable' resources for novice learners?</p>
<p>With a language like JavaScript, there is an immediacy to getting tangible results that Go doesn'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's a plethora of 'googleable' 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'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.
</2cents></p></pre>myringotomy: <pre><p>I am not fond of Javascript either but as you say it'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'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'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're not special because your a programmer. You just learn it, They are obviously there because they're interested. I guarantee you if the first thing you learned was about pointers, closures, or concurrency, you've said fuck this.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传