I've been volunteering once a week at a local school teaching 6th graders how to code, and it's really amazing how quickly many of them pick it up. Even small things like learning to mix blue and red to make purple using rgb(255,0,255) is utterly fascinating to them.
I asked one of the kids how he would like it if they taught programming as a subject in school. His eyes just lit up and said "that would be awesome".
It's also fun talking to kids about startups - the fact that you can use code to solve problems for people and start a business. They're usually more interested in building a fun game but still, you can see some flickers of awareness lighting up. A lot of these kids are selling candy to each other at school anyway, so they're pretty entrepreneurial by nature.
I guess this is a long winded way of saying that teaching kids to code is one of the most rewarding and challenging things you can do, and I'd highly recommend it to anyone on the fence.
I'm in university, and even here I wish there were classes that taught how to code. Everything is quite academic and high level, with little to no mention of how to learn a language, its libraries, how to code with a team, or any other day to day problems I face when making games.
>"Now just think how awesome you would be if you had learned how to code when you were seven years old."
Probably as awesome as I am as a baseball player, which I actually learned at age seven...and quit for spring soccer at age 9 because games and practices were so incredibly dull.
However, I suspect at age 9 I would have traded the prospect of a Saturday afternoon programming in a New York minute for sitting in the dugout during a baseball game.
The concept here is encouraging, but at the same time a bit disheartening when I consider how many of my peers have recently graduated or will soon graduate with expensive, decreasingly valuable degrees in subjects they love, but will have difficulty securing employment with. For instance, I have a good friend studying history right now who has recently taken up programming in an effort to spruce up his resume. I can't help but think "Why so late? Why didn't anyone nudge you in that direction when you were younger?"
I know my parents wanted me to truly understand new technologies, not just interact with them, so coding was an integral part of my life from an early age, but I fear many more parents probably saw the rate at which software was advancing and the promise of the internet and thought "Well, programming probably isn't that important anymore" (assuming, of course, that they had any opinion on programming at all).
He's a bright guy, so he'll be fine, but the fact that so many people my age will likely need to spend much longer acquiring and honing these skills (if they even bother to try) than children of the iGeneration is a bit depressing in the "Born just a bit too soon" sense.
When I watch how much my 3 year old son uses our iPad it makes me sad that there still isn't an integrated way to program the device on the device. Someone with more time than me should solve this problem.
How can you teach a seven year old to program? Kids of that age are hardly learning to add, subtract, multiply and divide numbers. How difficult would it be for a kid to grasp concept of function - in context of both math and programming.
Teaching kids how to program is not as easy and logical as it sounds. My opinion is to let a kid grasp and understand the basics - which are math, science and logic at an abstract level. Such a rush to throw everything at a kid is overkill IMHO.
These discussions often remind me of Little League parents debating the best way to teach preteens how to throw a curveball.
Teaching teens a bit of programming is another matter in some cases, but regardless of approach, most won't care enough about it to pursue it as an adult.
Exposing young people to programming is as important as exposing them to Faulkner, but probably not much more important.
> How can you teach a seven year old to program? Kids of that age are hardly learning to add, subtract, multiply and divide numbers.
Leaving aside the various educational bugs that lead to that situation...
For one thing, the earliest concepts of programming don't depend on math; that comes later. Think about something like LOGO here: the simplest bits just involve giving instructions to a computer like "go forward" and "turn left". More complex instructions like those used in fractal snowflakes represent a natural progression, and suggest the basics of functions and repetition. Similarly, think about LEGO robots: "go forward until you hit something, then back up and turn". You don't have to understand advanced math to implement that.
At some point around that age, I came across a simplistic algorithm in a geology book for identifying rocks, which provided a series of questions that amounted to a flowchart: does it split into layers, what color of streak does it leave if you rub it on glass, etc. I turned that algorithm into a simplistic pile of C, using printf to print questions, getch or similar to prompt for answers, and if/else to figure out what to do next. I had no concept of modularity or code reuse, open-coded the prompting logic for every question, and nested the conditionals to an absurd depth, but it worked, and triumphantly printed the kind of rock you had. :)
I think you are underestimating the capabilities of some children.
Take for example Gennady Korotkevich, at the age of 6 he was starting to program, and at the age of 11 he was already competing in IOI and also winning a silver medal, his programming (specially algorithmic ability) skill was already beyond of what your average programmer may get in his lifetime.
Maybe he is an extreme example, and he was born gifted, but i do think that there are many children which with proper guidance and encouragement can achieve levels of mastery in some topic like programming.
It presents various "arcane runestones" like "look ahead" and "look left", which send out "magic" over "threads of silk" to power other runes like "walk forward" and "turn left". The harder puzzles introduce AND and OR gates, and later on something similar to flip-flops to store "magic" and send it out later.
I agree with you (almost) entirely. My family got a Commodore VIC-20 when I was 8. I started "programming" immediately. Except that my "programs" were actually a series of PRINT statements, with an occasional input required for pagination. I was just writing stories, but doing it in BASIC. I distinctly recall being confused by the meaning of 'string' (the metaphor for stringing characters made no sense to my young brain).
I played with computers non-stop, however. To the best of my recollection, my first real programs started around the age of 12 or 13.
Changing the way we teach mathematics would probably do much, much more to improve our future than pushing programming on younger students.
Missing tassel in this puzzle IMHO: Something like Codea (iPad app, incredibly cool to learn programming to children) but as a web site, with a similar interface and "visual" objects, language Javascript.
After you create an app you should be also able to "name" it, so that <name>.this-site-name.com means instant-deploy of your app.
This is the thing more similar to BASIC of C64 that I can think, in terms of easy access, and ability to build something that you can actually distribute/show.
I hope that if I ever have kids, I'll be able to educate them as well as I can in (in no particular order):
1. Basic programming & general computer skills
2. A foreign language
3. The ability to learn by themselves
I have no desire to hothouse them of course, nor is it anything to do with improving their career prospects etc. I just look forward to sharing the fun of learning with them
Programming should be part of mandatory curriculum for students. I often sit at meetings an hear non-tech colleagues say things like "how does the internet work?" or "what are we going to do if the internet fills up". I would hope that theae ideas are taught...knowing many teachers who have very limited tech experience makes me worry...
Any opinions/experience on the best language to introduce kids to programming with? My instinct says python simply because I personally found it the easiest to get to grips with, but I guess practically anything will do.
Lua. Relatively simple language, but super fast (lua jit rivals C). Dead simple C api, so you can hook up whatever library you want to, if you need it (say GTK or even openGl, though I assume that somebody has already done that).
Either that or some form of Scheme. Not that it is simple to most programmers but it has very few basic pieces of syntax learn and when you start programming all of it is foreign anyway.
For a fun and gratifying first programming experience consider the visual programming environment Scratch: http://scratch.mit.edu/
I haven't found a more vibrant and impressive code-sharing community and it's a simple install.
Python would be a great first language, possibly using pygame for some early game-making gratification.
Etoys is also an impressively flexible visual programming environment http://en.wikipedia.org/wiki/Etoys_(programming_language) but its visual interface has a much higher learning curve than Scratch. Kids can explore the examples and figure it out, though, and it seems to have a higher ceiling.
I'm sure lots will disagree with me, but I say Javascript.
They already have everything they need on their computer now, and can start right away at JSFiddle and with various online tutorials that run the code on their own machines.
They can do useful stuff right away and share it with people immediately. (for instance, make a little game or graphic gizmo and put it on a web site)
It not only runs on the browser, but runs on the server (node), and in various other environments (MongoDB, Windows 8, etc). So again, their skills can be put to use quickly, and will be useful going forward in the maximum number of places.
There are immense numbers of people out there using it, writing about it, offering help on sites like stackoverflow, and so on.
For kids with short attention spans, the simplicity of javascript is a big plus. Being able to create objects on the fly easily, and not really worry about types and object orientation and all that makes it a lot easier to get up to speed quickly. (yes, there is potential for them to learn bad habits, but I think a far bigger risk is that they get bored and give up)
I'm still convinced that Logo is very hard to beat for a truly first-ever language. Drawing is fun, and Logo is all about drawing. It develops basic logic in a progressive manner.
> Now just think how awesome you would be if you had learned how to code when you were seven years old.
I started learning at 8 so another year wouldnt've done much.
In regards to the program this is really cool. I've been trying to teach my younger brother how to code to help him in his math classes at school. If you can break a math problem down far enough to be able to build a calculator for it, you must understand it, which is in fact why I started to learn to code so young.
Indeed it's really sad that here in the U.S. our school system's do not offer coding classes as electives. Though we still put a strong emphasis in offering foreign languages like French and Russian?
Having base coding knowledge and experience will go a longer way for our children then teaching them a foreign language like French, Russian and other languages!
> Having base coding knowledge and experience will go a longer way for our children then teaching them a foreign language like French, Russian and other languages!
People who make false dichotomies like these threaten to undermine the entire push to make programming and computer science available in lower education.
Our children should be able to learn a foreign language; our children should be able to learn to code. One is not better than another; what's important is that children have the possibility to learn both.
I agree with you! Working with children I realized how amazingly fast they are able to pick up anything you teach them. I wish I had someone to teach me coding at age of 8 or something. Its just amazing seeing kids do stuff in a weeks I myself could only do after months or years of learning programming
Indeed providing the option to learn a foreign language to our children is valuable.
Though for me what did five years of French class do for me? I would have preferred spending that time learning a skill that would help me later in life.
I wouldn't underestimate the importance of languages. Yes coding is important, that's the point of this thread, but natural languages as much as programming ones are integral to a good education, especially here on the other side of the pond.
Indeed it's really sad that here in the U.S. our school system's do not offer coding classes as electives.
They don't? I took Logo and BASIC programming on the Apple IIe in 7th and 8th grade (1988, 1989). BASIC on the PC in 9th. Switched to Pascal and covered all the basic data structures and algorithms in 10th - 12th grade. That was a looong time ago. Surely computer education in schools has only improved since then in most places, right?
I took basic in 4th grade (89). We were introduced to Logo in 7th grade math. I hit a limit in the amount of extra credit I could get from Logo drawings :)
I grew up in a tiny town of 3000 in the middle of Kansas.
That maybe the case in some select schools and those schools are now offering html,css,photoshop,javascript, python, ruby, iOS, java, php and others. Though those schools are not your average schools.
In general the school system is still more focused on offering foreign language classes to students then teaching them coding languages. The latter skill being more valuable then the former!
But the former being far more valuable for understanding one's own language, and preparing a young person for college-level reading and writing.
That said, based on my own experiences, I think that a fast-track program could be developed to create functional, real-world (e.g. CRUD apps) developers straight out of high school. Basically, technical school for the modern world.
I had similar exposure in school, but from what I've seen with the young people in my family, it's gone the other way. There are no computer classes. They don't even teach typing anymore.
That's interesting, and appalling. I'll have to look into this more.
For the record, I went to a completely average high school in the Pacific Northwest. It was neither a rich nor poor district. There was no meaningful computer industry in the area. I have to admit that we did get a relatively awesome CS teacher when I was a sophomore, and without the freedom he granted us, I likely would not have gotten half as far as I did.
I went to grade school in Redmond, WA. Interestingly, there was seemingly no Microsoft presence at all - it was all Commodore PETs and Apple IIs.
I wonder if the attitude in some schools is "everyone has a computer at home and knows how to use one now", so they shrug their shoulders and feel like there's nothing left to contribute. The kids print out or email their homework from their computers, so maybe they think that's all buttoned up.
I wonder if the interest in programming is even there anymore. When I was a kid, it was amazing to draw lines and colors on the screen (and sometimes, colors weren't even an option!). These days, I wonder if kids still delight at making the computer render simple drawings and programs, or if XBoxes and Facebook have rendered such trivial programs uninteresting.
I always think of this. Not because I have kids, but because I teach children coding(web development). I have 2 groups, 13-14 years olds and 15-16 years olds. The younger group learns everything twice as faster. I plan to teach my kinds basic logic, maths, chess and after coding starting from age 4.
Do you have any tips or resources for teaching children? I have a 12 year old in the family who I would like to get started. I can teach him html/css but anything beyond that we would be learning together.
I ususally use lynda.com resources. I also have problems with teaching something beyond html/css, but usually with enough repetitions and assignments students finally "get it". Brightest students of mine are the ones who really interested in programming. So, in order to make it interesting, I tell them about what sites like Google and Facebook are programmed like, how their best video games work, how they can make a "simple" version of their facebook like social site. They seem to get motivated by those talks of mine :)
I think it makes sense to mention the potential influence of raspberry pi on education here, it's potential that is to provide far greater accessibility to a superior coding/learning platform in education. The next few generations might just be raised as linux users.
Coding is great, but what about exposing them to some hard, meaningful problems while we're at it as well? Otherwise, we're just gonna get 10 times more photo sharing apps in the future.
Now just think how awesome you would be if you had learned how to code when you were seven years old.
Not that much, if I happened to want to work in any other totally unrelated profession, like a language teacher or a chef or a doctor. Now, imagine how awesome I would be at MY chosen non-coding profession, if I had learned it since seven years old. Which actually doesn't make sense, because I hadn't made my choice of profession yet.
So let seven years olds just be, and if some of them are programming prodigies, OK, but not everyone has to learn to code. It's just programmers thinking they are "the shit".
Here's another thought: kids are the future, teach them how to behave and be considerate.
Learning to program (at least, learning the right way) teaches important skills independent from the actual ability to program. Most importantly, it teaches the ability to abstract and see patterns. Take a look at https://rwxweb.wordpress.com/2012/01/31/teaching-algorithmic... for an example.
Not just the ability to abstract, but the ability to think at a very granular level of detail and multiple levels of abstraction simultaneously. Not many fields do that to the extent programming does. And the instant feedback loop reduces the need for expert outside guidance and instruction.
There's also the idea of CS + X, for all X[1] (or for most X, as batista points out).
Not just the ability to abstract, but the ability to think at a very granular level of detail and multiple levels of abstraction simultaneously. Not many fields do that to the extent programming does.
Thank you for suggesting a generalized benefit of learning programming. My oldest son (grown up now) is a programmer, and maybe there is something to what you say. I'm glad he had early opportunities to learn Logo, C, and Scheme as part of thoughtful computer science curricula before he finished his high school education. Anyway, I'll encourage all of my children to go beyond the programming I reached decades ago with a time-sharing terminal running BASIC back in the 1970s.
But if I think about this issue of the educational benefits of learning this or that subject on multiple levels of abstraction, I wonder if the unique benefits of learning programming are really all that unique, and really all that generalizable to domains other than programming. I raise this question as someone whose last formal higher education was in law, a domain in which I practiced for a time, before turning my attention to specific issues of policy that are not all issues that raise legal questions. As I look at public policy discussions here on Hacker News, and especially at threads in which legal issues are discussed, I don't often have the pleasant experience of seeing multiple-level abstract thinking going on in those domains. Usually the comments here on HN about public policy or law look as elementary as my comments about programming must look to any experienced programmer. Many of the best comments about law on Hacker News, perhaps to no one's surprise, come from lawyers. Maybe the ability to think really abstractly (and correctly) on multiple levels is much more domain-specific than people who have been trained and practiced in one domain but not another usually acknowledge. Maybe part of domain-specific expertise is an "ability to think at a very granular level of detail and multiple levels of abstraction simultaneously," without much transfer of that ability to other domains.
Knowing I am among learned people here who like to think, I'd be happy to hear the comments of any onlooker to this idea that learning is often stubbornly domain-specific.
My dad and sister are lawyers, and I seriously considered it at one point (took an LSAT course), so I have some familiarity with it. My impression of the field is that it's similar to programming - very detail and abstraction oriented. To think correctly at higher levels of abstraction over any domain, you have to know the details and fundamentals of it, be it law or programming.
As far as the differences, I'd like to say that there is less room for error in programming, since you're working with a perfectly literal machine. However, you can create incorrect abstractions that fail to run and immediately throw errors, but you can also create incorrect abstractions that do run, but return either obviously or subtly incorrect results. Not so different from the legal system.
So I suppose the big difference is the relative accessibility of the two. As soon as you buy a $200 netbook and start programming basic, c, or whatever, you're immediately subjected to the instant feedback loop. With law, you can take a few courses in undergrad, or go to law school. But attempting to learn law on your own, without guidance, is probably easier to go off on tangents, than attempting to learn programming on your own.
In either case, transitioning the skills from one domain to another will require some study of the core body of knowledge, hence the state of legal discussion on programmer sites (and state of tech discussion in Congress, for that matter).
First, I'd suggest that HN comments about legal issues sound so "amateurish" (on the scale where "professional" means "lawyer") because they have a heavy bias towards how we believe the law ought to work rather than how it does work. Abstraction, generalization, logic, and other CS problem-solving skills don't automatically provide an understanding of a field whose details often seem utterly contrary to rationality, without the addition of a pile of domain-specific training to understand the idiosyncrasies of that field. :)
Law sometimes seems to have the most in common with machine learning techniques like neural networks: start with something simple, evolve it in small steps based on potentially-flawed fitness functions, hope you don't get stuck in a local maximum, and in the end end you have a tangled mess that more or less gets the job done but which nobody can fully understand or explain. :)
More seriously, I think abstract thinking and similar methods do help in law and many other fields, but they complement knowledge of those fields, rather than replacing it. You still have to understand the details of any field you want to work in. However, abstract thinking helps greatly when attempting to apply that knowledge.
The article I originally linked to, https://rwxweb.wordpress.com/2012/01/31/teaching-algorithmic... , mentioned an applicant for a CS job who didn't know how to sort words because they'd only memorized an algorithm to sort numbers. The same issue would apply to a lawyer who doesn't know how to deal with a stolen meal because the examples they'd worked with only dealt with stolen cars, and (hypothetically/rhetorically/probably-untrue-in-reality) because the law doesn't specifically talk about stolen meals. (Feel free to provide a more relevant example; I don't have the expertise to supply a higher-quality analogy.) And on the flip side of that, just as a programmer ought to know some of the quirks that apply to strings but not numbers (such as dealing with locale-specific sorting), a lawyer also needs to know the specific quirks that apply to stolen meals versus stolen cars (such as "theft of services"); otherwise, in both cases, they'd wind up with faulty generalizations. So, experts in a field need both the abstract-thinking skills that apply to any field and the knowledge of the specific details of their chosen field.
This is an interesting point. Like tokenadult, my last graduate education was in law, which I currently practice, although I also know how to code, but don't have a particularly "formal" education in it. Law school (debatably) doesn't prepare you to actually practice law, but it does attempt to teach you to "think like a lawyer." The presumption is that, once you have this thought process down, and know some fundamentals of law (almost exclusively taught in the first year of law school), any "details" of the law that may be necessary to actually practice law are easily acquired, because you know where to look, what to look for, and how to use that knowledge. From my experience with CS, I don't think this is particularly different than how many coders are trained to think and apply knowledge. For example, someone that didn't know how to sort words because they'd only memorized an algorithm to sort numbers would seemingly have received a failed education in CS, as a lawyer who doesn't know how to deal with situation X because they only have dealt with situation Y would have received a failed education in law.
However, I take tokenadult's point to be that the lack of analytical reasoning as applied to law by some commenters on this site is very unfortunate given that presumably the same thought processes go into coding, which many people on HN are very skilled at. I agree that some fundamental details of law are important, but I think these details are far fewer than non-legally educated people believe. The whole idea of "the common law" as applied in the United States (in contrast to, say, doctrinal "civil law") is that it should be accessible: this is exactly why judges give reasoned opinions, as opposed to decrees, and much of the ideological underpinnings of the common law rest on the presumption that law simply "exists" in the ether, and one only had to meditate on it to discover it (for example, we used to have non-codified crimes, we still don't accept "mistake of law" or "ignorance of the law" as a valid defense, even if it practically would be impossible for someone to know of a law's existence and so on). We've obviously moved away from that presumption, but, from my perspective, law is intended to be accessible, not arcane.
It's therefore highly unfortunate, and possibly the fault of the legal profession, that law, today, is seen as inaccessible. Reading a legal opinion is not an exercise in futility--it's intended to be read, and often intended to be read by people with little knowledge of the underlying subject matter. I would challenge people, particularly coders skilled in analytical reasoning on HN, to take the time to read judicial opinions in their entirety on legal topics of interest, because I strongly believe that the analytical reasoning one uses in coding does have excellent applicability to understanding legal decisions. Law is NOT as convoluted as many presume, and judges try every day to harmonize conflicting legal concepts--in fact this is largely the entire job of appellate judges whose opinions one might read.
No one here would discourage non-coders from getting their teeth wet by doing something--anything--related to learning how to code, even if that person didn’t go to school to learn it. But, commenters on HN would be perplexed if someone didn't bother do that at all, but then tried to express an opinion on some programming technique they never bothered to learn about. This is the same sort of perplexity I get when people comment on legal topics without reading or knowing the much about the (accessible) underlying topic.
Sounds like maths taught properly. Why not just do that instead?
As an aside, it is a watershed moment in any profession when the practitioners find themselves believing that their profession is so fundamental it should be taught to all children. Bravo, coders of the world :)
I'm sick of hearing that we need to teach kids to code. No, we don't. This idea comes from other coders who seem to be living in a bubble. It's important that we teach kids to be computer literate but coding is not an essential skill. Do we need to teach all children to be doctors? I mean, we all have a body that needs to be taken care of, right? Do we need to teach all children how to assemble an automobile engine? No, driving the car and being able to check the oil or change a flat will suffice.
Programming just isn't for everyone and no matter how often or loudly you scream that it is that doesn't make it so. Coding is hard and people think its boring. They won't persue it any further than they would a sport their parent puts them in that they dont like. There are things that all children should learn like reading, writing, and math but you wouldn't say all kids need to be trained in writing like a writer would or that mandatory math needs to incorporate the kind of stuff the guy from A Beautiful Mind was doing, right?
In the same way that we all need to know how to read, write, and do basic arithmetic, that's how we need to teach kids to code. Sketch the broad strokes of how a computer works. Give definitions of hardware and software and teach them how they interact with each other. Introduce them to the concept of binary data and how all code is just one's and zeros. After that it should just be up to the child to decide if they are fascinated enough to learn to code. Even if there is a shortage of software engineers it doesn't matter. Teaching kids to code young won't help them pursue it any further if they aren't interested. No one taught programming in schools years ago but I love it. I became fascinated with the idea that I could make the computer do anything I wanted and there are a lot more like me that did just fine without being taught it in schools. That's how any profession is, really. Pilots don't become pilots because they took an aeronautical engineering class, they do it because when they're little kids they see a plane in the sky and say "wow, I want to fly when I grow up". Same with programming. Somewhere, a kid who never has or will take a mandatory programming course before college is sitting at the computer, browsing Facebook and thinking "wow, I want to make my own websites/games/other software when I grow up".
I asked one of the kids how he would like it if they taught programming as a subject in school. His eyes just lit up and said "that would be awesome".
It's also fun talking to kids about startups - the fact that you can use code to solve problems for people and start a business. They're usually more interested in building a fun game but still, you can see some flickers of awareness lighting up. A lot of these kids are selling candy to each other at school anyway, so they're pretty entrepreneurial by nature.
I guess this is a long winded way of saying that teaching kids to code is one of the most rewarding and challenging things you can do, and I'd highly recommend it to anyone on the fence.