TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What would you teach adults new to programming in a 2 hour class?

14 点作者 brw12大约 8 年前
I teach what I call &quot;creative technology&quot; to kids (my company is adaandleo.com). Parents keep asking me to teach THEM about this stuff. In particular, I keep getting asked, &quot;How can I understand what programming IS?&quot;<p>In other words, what these parents want is:<p>* a taste of what the experience of programming is like<p>* to experience what&#x27;s unique to computer science, as opposed to adjacent fields<p>* to walk away feeling that they have programmed<p>What they are not looking for (from me):<p>* useful vocational knowledge (I mean, they wouldn&#x27;t mind some, but that&#x27;s not the point)<p>* the same circuits-Scratch-3d design &quot;art class and tech class had a baby&quot; curriculum I give kids<p>HN, any ideas?<p>Some things that come to mind:<p>* I could use a platform like coderpad.io to manage coding environments in a lightweight way<p>* It seems to me that Python and Ruby are roughly close to the sweet spot of clarity to a beginner; I want to avoid too much cleverly terse syntax, and be able to focus on basic building blocks such as arrays, functions, and loops.<p>* I keep coming back to CS intro concepts like sorting arrays and recursion, but a) I&#x27;m not sure how to neatly visualize these, and b) I worry they&#x27;re not really that representative of programming work<p>* on the other hand, if I were TOTALLY realistic I&#x27;d have them try to update XCode certificates for two hours :)

12 条评论

kenshi大约 8 年前
I think I would do the following:<p>- set up a web page with some minimal and familiar interactions.<p>- with the adult student, visit that webpage and let them use it.<p>- then bring up the browser&#x27;s web dev tools and show them some ways they can modify the content and behaviour.<p>- to wrap up maybe go to a website they use regularly, and bust out the web dev tools and do some minor modifications.<p>Why I think this approach would be good:<p>- people are familiar with web pages, so it provides them with some context of programming and how it effects the &#x27;real world&#x27;. (Different to just programming something that would seem highly abstract, such a command line app)<p>- letting them see the web dev tools after having interacted with the page would hopefully enforce the idea that they are going behind the scenes&#x2F;seeing the insides of something they use. The idea that code and programming &#x27;powers&#x27; things they use.<p>- modifying the code, should give the student that they can manipulate and change what they are interacting with on the screen. Again, conveying the power of programming, and perhaps a taste of what its about.<p>- final thing is to modify something&#x2F;peek behind the curtain of something they like and use often. Hopefully to convey the idea that fundamentals of programming apply to the big brand websites as much as the toy website they have been playing with.<p>I&#x27;d be interested in hearing feedback on the above approach!
评论 #13790807 未加载
评论 #13770934 未加载
gingerbread-man大约 8 年前
I don&#x27;t think it&#x27;s possible to do any better than this: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dlbMuv-jix8" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dlbMuv-jix8</a><p>Admittedly, when I found my way to Sussman&#x27;s course, I had already been programming for awhile, so the &quot;magic&quot; was less of <i>Wow, I can write a computer program that does neat stuff!</i> and more <i>Wow, this makes everything I&#x27;ve been doing so much more clear and simple!</i>
评论 #13795175 未加载
matt_s大约 8 年前
Simple: build a calculator. They are adults and should know basic math so they have a comfort zone and would know if the computer did it right.<p>Introduce loops (add a string of integers like &quot;1 2 5 8&quot;), functions to run those (add, multiply, etc.)<p>Don&#x27;t get all computer science-y on them with recursion, sorting or stuff like that in the first 2 hours of an introduction.<p>It might be a lot of work to setup 20 computers with something like Ruby or Python - assuming you ask them to bring their own laptop. That might take 2 hours itself. Just find some online Javascript (shudder) editor thing which will allow them to build a basic calculator - no UI though, that&#x27;s too complex for 2 hours.<p>Programming is just telling a computer to do things. They are parents and should be familiar with that concept, except the computer will do exactly what they ask, unlike kids.
评论 #13790779 未加载
js2大约 8 年前
I don&#x27;t know, is 2 hours long enough to walk them through a spell checker?<p><a href="http:&#x2F;&#x2F;norvig.com&#x2F;spell-correct.html" rel="nofollow">http:&#x2F;&#x2F;norvig.com&#x2F;spell-correct.html</a><p>OTOH, <a href="http:&#x2F;&#x2F;norvig.com&#x2F;21-days.html" rel="nofollow">http:&#x2F;&#x2F;norvig.com&#x2F;21-days.html</a>
brw12大约 8 年前
Thanks for these ideas, all! I like the approach of using the browser console and source inspector, though that has the problem that everything gets reset if you reload -- there&#x27;s not really a way to save your work or see the js code you&#x27;re building up in one place. So I don&#x27;t think I&#x27;ll ONLY do that.<p>Doing JavaScript in a jsbin-type environment seems like a good way to go. I think it would also be good to show them how to post a simple bootstrap page online. Maybe I could:<p>start them in jsbin with a minimal HTML page with no styling (10 min)<p>Have them add a few elements; Point them to a cheat sheet of commonly used tags (10 min)<p>Add Bootstrap and jquery; talk about how programmers rely heavily on each others existing work (5 min)<p>Make something neat using bootstrap, like a drop-down menu (15 min)<p>Show them how to post it online... Maybe using one of those super simple drag and drop hosting demo sites, maybe using GitHub pages, maybe just using jsbin&#x27;s static urls (5 min, using jsbin)<p>Make a text input and have it do something cool like simultaneously change the headline of the page (15 min)<p>Show them you can inspect and tweak your page (10 min)<p>Show them you can do the same with nytimes.com; tweak headlines and styles (10 min)<p>Give them a very simple program in C that inefficiently sorts a random array with a size that is set in a variable and prints out the result (10 min)<p>Show them how to compile, and look at the resulting binary; talk about the levels of abstraction a computer has (10 min)<p>Run the binary. Then try various sizes of array and run them, and report back. Have students organically discover the importance of time complexity. (15 min)<p>Explain that part of programming is thinking about the architecture of the algorithms, edge cases and scaling and how a program performs when unexpected situations are thrown at it. (5 min)<p>Explain that most of the apps and programs that use everyday or basically no different than the programs they just wrote, just a lot longer! (5 min)<p>Total: just under 2 hours.<p>Overly ambitious? :)
taurath大约 8 年前
Get their hands on something usable and relevant as fast as possible. I like using very precise and specific instructions for creating a twitter &quot;every word&quot; dictionary bot for instance. Simply exposing people to the idea that there is a whole world they can interact with with code (via an API) is a very powerful concept to get people interested in coding. It makes them go &quot;aha!&quot; when they think of all the apps and technology that use in their every day life and wonder how things work.
fillskills大约 8 年前
Perfect - I currently teach this to my sales agents and customer support team ( I am founder at a startup). They come from varied backgrounds and had zero knowledge of programming. Most of them actually wanted to know some very very basic things like : - What is a computer - What is a program - How does internet work<p>What I taught them in the first two hours: - What is a computer made of (Hardware, logic gates, cpu etc) - What is a program and how it runs on a server (How does a simple program look like and how does it go from high level code to being run on a computer) - How is the internet set up and how does the browser use it to find stuff - What is a browser - History of the internet - What is the difference between Front end, middle tier and database - Database basics like how is data actually stored physically - Write a simple python program<p>.... and now I go into actually building a website end to end with basic Html, css, JavaScript, some backend language, database. But thats more than 2 hours.
mamaniscalco大约 8 年前
I honestly believe that learning to program is similar to learning to speak languages. You can&#x27;t truely learn them after childhood. Atleast not in the way that you could when you were a child - in the way we learn our native languages. That certainly doesn&#x27;t mean that someone can&#x27;t &#x27;learn what programming is&#x27; but I have serious doubts that someone who learns to program as an adult will ever actually program like a native.<p>I could be wrong on this and I&#x27;m sure there are some exceptions. But I suspect the answer to your question could only really come from a gifted teacher. Asking a seasoned developer how to teach someone who has never programmed is probably akin to asking seasoned artist how to draw like a child. They probably can&#x27;t really know the answer because of their level of sophistication and the fact that their brains have long since migrated the skill from the section of the brain that learns to the section of the brain that masters.<p>I&#x27;m certainly no teacher but perhaps something with a gentle learning curve such as basic HTML where the reward to effort ratio is faily high. Or the classic &#x27;guess a number from 1 to 10&#x27; type of program which is easy to accomplish with a little assistance and teached loops, print to console and variables.
评论 #13770081 未加载
gingerbread-man大约 8 年前
Two hours isn&#x27;t really enough time to go from zero knowledge to <i>programming.</i> The first two hours or so are, almost inevitably, going to be spent learning the syntax and the interface; real programming begins when you start using that knowledge to solve problems.
评论 #13773086 未加载
评论 #13769830 未加载
ilaksh大约 8 年前
2 hours is small. How to open developer tools in Chrome. Change colors on an existing web page. A &#x27;for&#x27; loop with document.write some numbers or something.<p>Maybe get them to sign up on codepen.io
bsvalley大约 8 年前
I would expose the potential risk of automation in a near future. Making them aware of learning something that might disapear in 10 years, for the most part.
Spooky23大约 8 年前
Excel VBA with some practical examples.