10 ms·
How My 10-Year-Old Learned JavaScript
- partycoder 10y agoLet's not forget that it was not rare that kids learned Assembly in the 1980s.
- smnplk 10y agoAlso, let's not forget that some more fortunate cough John Carmack's cough kids are exposed to lisp in this day and age. https://goo.gl/Fy4CSa https://goo.gl/Fy4CSa
- Theodores 10y ago...6502 instruction set and things like undocumented Z80 instructions can be fully memorised as a child, even if some concepts, e.g. a stack, strange maths, comes later. If only I could remember syntax so well now.
- marisa_kirisame 10y agoZ80 assembly was the first 'real' language I learned as a kid (I did some basic GWBASIC but never got far with it). I wasn't very good at it, but I did write some programs that did what they were supposed to do.
- mwcampbell 10y agoGood to know. I learned Applesoft BASIC when I was 8 (in 1988-89), then moved on to 6502 assembly around age 11 or 12. I copied a lot of assembly routines out of books, though. And for some reason I can't remember now, I especially struggled with the Apple ProDOS Machine Language Interface (MLI). When I first expressed interest in learning to program at age 8, my mother told me that an 8-year-old couldn't learn to program. Fortunately, I found a way to begin learning without any involvement from my parents (our computer, an Apple IIGS, came with a disk that included an introductory lesson on BASIC). I guess she just assumed I couldn't learn at that young age because home computers were still relatively new, so kids hadn't had direct access to computers for very long, so people just didn't know yet what was possible or realistic.
- octorian 10y agoI never did, but I often wonder if it was due more to a lack of exposure than anything else. Back then, one's exploration was somewhat limited to what resources the surrounding adults provided you with. And when none of those surrounding adults are "computer people" in a useful sense, you don't get exposed to all that much. The computer itself, and its supporting documentation, tended to just dangle BASIC in front of your face and little else.
- aibottle 10y agoThere is no learning JavaScript. There is only the ability to use StackOverflow and Google Search. ;)
- fiatjaf 10y agoWhat programming language do you think is different from that?
- knieveltech 10y agoAny language that was learned 15+ years ago.
- shurcooL 10y agoOne that has a very readable specification that fits on a single page and has been read by most people using the language. For example, https://golang.org/ref/spec https://golang.org/ref/spec.
- prashnts 10y ago> fits on a single page That's ~88 A4 sheets when printed.
- shurcooL 10y agoA single web page. My point stands, is there an equivalent page for JavaScript?
- eropple 10y agoI think JavaScript developers know how to make single web pages. http://www.ecma-international.org/ecma-262/7.0/ http://www.ecma-international.org/ecma-262/7.0/ But you're just trolling (and for something mediocre in the first place, sit down, he said from his lofty perch), so you should stop.
- macpete 10y agoThe main target audience js was made for :-P
- sctb 10y agoThis isn't the kind of comment Hacker News is intended for. Please review the guidelines: https://news.ycombinator.com/newswelcome.html https://news.ycombinator.com/newswelcome.html https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- commentzorro 10y agoShould have started him with Haskell so he would learned monads and functors right from the start with no mutable object baggage to trip him up. Maybe a few weeks of child level category theory first.
- detaro 10y agoAny references for "child-level category theory"? I suspect that would be helpful for many non-children as well.
- deleted 10y ago[deleted]
- rottingtree 10y agoHow about this: https://www.amazon.com/Conceptual-Mathematics-First-Introduction-Categories/dp/052171916X/ https://www.amazon.com/Conceptual-Mathematics-First-Introduc...
- kowdermeister 10y agoI really hope you are kidding, because this was the funniest comment I've read today and I already scanned Reddit :)
- smnplk 10y agoI would sit him through a few Leslie Lamport lectures on category theory, maybe just 10 hours worth of material. I think this would be enough to get him stared with Haskell.
- anondon 10y agoWhy Haskell, the kid should have started with Lisp.
- flexie 10y agoWhy lisp? Kid should have learned assembly, or better yet; pure math. Now he is corrupted already.
- pacaro 10y agoI wonder if closures are easier to understand in languages with clearer (or tighter) scoping rules. I notice that the author doesn't have an analogy for scope on his article
- pacaro 10y agoOk let me take a stab at it. Variables are imagined as containers. Those variables/containers exist within a scope. Let's take an example where a room is the scope. That room is in an apartment, which is in turn in an apartment building, in a city and so on. Code whose scope is that room can access containers in that room, or in the open areas of the apartment (but not in other rooms without special arrangements being made), or in open areas of the building (but not in other apartments …) etc. So code in my room can look inside a container in the hall, but not in a container in your room. And vice-versa. A closure allows this special arrangement to look in another room. I can create a closure in my room. This is code that can access the containers in my room, but it has the special property that it acts like it is in my room even when it isn't. So I can give you this closure and you can run it in your room. When it's running in your room it can't access your containers (except as arguments) but it can still access the containers in my room. My daughter is two. I'm looking forward to taking this journey with her
- nether 10y agoKids should be outside playing and interacting with other kids, not coding.
- stymaar 10y agoWhy not both ?
- vegabook 10y agobecause coding can be unhealthily addictive.
- asveikau 10y agoYeah, it might also lead to something called a "career".
- vegabook 10y agolike that's what you're supposed to be worried about at age 10. Ridiculous.
- stale2002 10y agoAnd some people just find it fun? I remember making starcraft custom maps, using "programming", back when I was 10. I didn't care what programming was. I just wanted to do fun stuff with Starcraft!
- blowski 10y agoSo can exercise, eating, playing, and studying. Teaching kids moderation is also important.
- Klathmon 10y agoGod forbid kids learn a skill. When I was 10-11 I loved making silly little programs in BASIC. I had fun, it was something I could play with my friends with (a lot of my time was spent in a silly "chat bot", and a "choose your own adventure" text game), and I'm almost certain it led to my career.
- jtcond13 10y agoCool write-up. Programming is a great thing to learn as a kid.
- uniclaude 10y agoThis reads like the author really wants his kid to learn programming, and the article shows more interest from the parent than from the child. That's obviously anecdotical but I'm very glad nobody steered me into programming. It was my private garden, and I enjoyed every single second of the freedom it gave me. Writing my Delphi programs was funnier to me than programming books. I think my point here is that I'm not sure it is in the best interest of children to push them into our passions. Then again I'm not a parent, so my opinion doesn't hold much weight!
- bluedino 10y agoI found programming myself on the family computer. Although, I'm not quite sure how I found 'QBASIC.EXE' when all I had were Apple II and Commodore 64 BASIC books in the school library. What I needed back then was someone to give direction and help. If I ever have children my plan would be to make them aware of programming, and if they try it, good for them. I'll just mentor them along the way.
- bluedino 10y agoI found programming myself on the family computer. Although, I'm not quite sure how I found 'QBASIC.EXE' when all I had were Apple II and Commodore 64 BASIC books in the school library. What I needed back then was someone to give direction and help. If I ever have children my plan would be to make them aware of programming, and if they try it, good for them. I'll just mentor them along the way.
- sAuronas 10y agoI will add to his anecdote with my own. I have been teaching my nieces (10 and 16) how to program and I approached it the same way. My 16 y/o niece was told Python was the way to go, but I resisted teaching her that. I'm an iOS developer that learned the 3 bears of web, JS/Ruby/Python, when I started teaching myself. While there were many things to appreciate about all three, the most useful to me was ability to open up a website and see its contents. To build 'hello world' in three smalls files and load into a browser without the internet (kind of a big deal when your niece loses the internet - and electricity - from time to time. Cause: poverty) is eye-opening at that age. Showing someone you are passionate about something and teaching that - passion... THAT is the best thing you can do for a young mind. The worst outcome is that they are not interested long-term but harness what they learned from you into something else. The best outcome is that they love it and eclipse you at some point earlier in their own careers. I'm not a parent either, but even if my nieces choose other fields (odds are they will), they will be better off for having some technical training before doing so: they will dig far deeper than what's required because they were trained to think that way. One of my nieces is an artist. She could draw better than I could as an adult at 12 and I had formal training in industrial design! Showing her that code is just a lower level of artistic expression is something I wish someone would have told me at her age. Doesn't matter to me if she goes into ID, UX, SD, or CG. I don't believe you can have too much directed exposure.
- cdevs 10y agoFeel like that title needs a tweak.. Learned JavaScript ? Or learned about JavaScript. Maybe "how I kept my kid interested in programming", "short attention span vs programming", "getting your child into programming". There's a pretty good click bate video on YouTube that says "15 year old dreams in code" and it was something along the lines of he made game where the ball moves to the left and right with your keyboard and score increments...basically the tutorial for his framework. I think the problem is the school system not pushing some of these basic introductions into a few classes. There was a time unix commands were day to day office needs for almost every employee at certain places...and then poof the GUI killed it.
- kowdermeister 10y ago> He just lost motivation. I guess command line output only motivates a kid so much these days. That's why we made text based games and an tkinter based RPG game at a coding bootcamp where I do mentoring.
- hguant 10y agoHonestly, the two things that kept me motivated to keep writing (actually writing, not just "oh hey this is cool") code when I was learning were games and my girlfriend. Games - We were learning how to play Pathfinder, so I wrote a little character creation thing in Python. Girlfriend - thought it was awesome when I wrote her letters that were interactive programs. Though I found out later she didn't want to go through multiple times to find everything I'd written, so she just skipped to reading the source.
- tribby 10y agoI'm glad to hear this is still happening! I learned C as a kid some 20 years ago writing a text-based RPG. It was just the right balance between "look everybody I made a game" and "wow there's a lot more to learn," which is a pretty ideal outcome for someone new to programming. That said, I only got into C because I was already tinkering with computers and BASIC, and I don't think my young curiosity about machines would have held if I were being instructed to learn them by an adult. Kids are funny like that.
- niftich 10y agoAn anecdote about motivation: when I was in grade school, I made custom maps and scenarios for Starcraft (the original), with if-then-else conditionals, and the like. The official editor had a wizard where you would enter these, but it was extremely tedious to use, requiring lots of mouse clicks. Alternate editors were starting to come out that would let you enter these events as a script, so I turned to scripting instead. After a while, hand-writing the script was becoming a chore, so I wrote a code generator. I realized that the browser had a script interpreter and I could just use checkboxes and form inputs and lots of Javascript to manipulate a bunch of 'document.write()' statements to produce copy-pastable code. I had no interest in programming, and yet I using programming as a tool without realizing it.
- kampsduac 10y agoCongrats on sharing with your son! I would be interested to learn how he responds to https://groklearning.com/ https://groklearning.com/
- neovive 10y agoThat looks very interesting, especially the competition aspect. He might have to brush up on his Python a bit. He also enjoys CodeCombat, which I forgot to mention in the post.
- tobilg 10y agoThanks for the interesting article! Are there any recommendations for non-English speakers? I'd be especially interested in German materials. I'd love to teach my eight year old daughter about computers and programming, but there are close to none books and resources available if the kid doesn't speak/read English yet.
- mattnewton 10y agoI honestly didn't recognize his description of closures. It sounded like memoization. Closures are probably best understood without metaphors like that, scoping in JavaScript might be weird but it is consistent everywhere- only functions have scope, and they carry that scope for their entire life. I think just thinking of everything in the language as a collection of scopes really clicked it for me. The real trip up with javascript I often see even in professionals is asynchronicitiy, since JavaScript has a run loop.
- nv-vn 10y agoThat description of closures is really odd to me and I know for a fact that it would not have worked on me as a child. After spending some time teaching programming to middle schoolers/high school freshmen, I think they're really something that comes more naturally than that. The way scoping works for closures is almost instinctual in my experience, but the anonymous part is much harder to understand. Trying to write functions inside of functions is also fairly natural (although you might have to nudge the kids into that style of thinking), so you can teach closures with the use of named inner functions. I still haven't found a great way to teach lambdas that really sticks without them writing some code first and seeing how they can fit lambdas into there...
- deleted 10y ago[deleted]
- mwcampbell 10y agoWhat do you think about teaching JavaScript as the first programming language rather than Python? I know that some think JavaScript is a better choice [1], because it's so much easier to produce a real application as opposed to a command-line toy. But the opposing argument would be that JS has so many flaws, or more charitably, it's such a quirky language. Also, any opinions about Khan Academy's platform and lessons for learning to program with JavaScript [2]? I'm not a parent, but my friend's 10-year-old son has asked me to teach him to program. [1]: http://prog21.dadgum.com/203.html http://prog21.dadgum.com/203.html [2]: https://www.khanacademy.org/computing/computer-programming https://www.khanacademy.org/computing/computer-programming
- brianwawok 10y agoI would never inflict JS on a kid I liked
- mwcampbell 10y agoIs that just knee-jerk dislike of JS? If so, that's nothing new. Haters gonna hate. Or are there specific language misfeatures that you think get in the way of learning?
- freehunter 10y agoI think JavaScript is a perfect entry point in a way that Python doesn't seem to even try to be. Sure there are warts and syntax problems and it's a little weird but beginners for the most part won't even run into that. But for that one small, minor downside, all of the upsides far outweigh it. It's used everywhere (almost literally) so it will always be relevant. It's super trivial to get something to print graphics on a screen, where Python graphical frameworks are scattered, outdated, or limited in functionality. Compare PyGame to Phaser and you'll see what I mean. JavaScript is the right way. Python is right for a budding computer scientist who won't care that they're limited to a terminal for months while they learn. Javascript is right for everyone else who wants to see some immediate and modern progress while they're learning.
- 10y ago
- lttlrck 10y agoThe closure description sounded more like memoization.
- iamcreasy 10y agoLoved this article. I especially liked the 'Explaining programming concepts to kids' section. Please keep us posted about what your kid is building next.
- icambron 10y agoLike a few people in this thread, I didn't really buy the closure analogies. I think if that were my first exposure to it, I'd end up with some pretty wrong ideas about how they work. Specifically, it's not a snapshot. I was bothered enough that I went and quickly wrote an explanation of closures in five steps. The language probably needs tightened up a bunch, but I'm curious if it's useful? https://jsfiddle.net/hghgp6x2/ https://jsfiddle.net/hghgp6x2/
- fiatjaf 10y agoProgramming is so easy anyone mildly interested can learn it. Specially a kid. The key point is the interest. Kids will never be interested if they never hear about programming, but you can also not force interest on them.
- sn9 10y agoRealm of Racket would likely have been a really good alternative. Maybe NAND to Tetris.