How My 10-Year-Old Learned JavaScript
hackernoon.com
hackernoon.com
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!
My son's experience has generally been self-driven via Scratch. I introduced him to Scratch at around age 7 through CoderDojo and he really enjoyed it (I'm a big fan of Scratch for kids--it's the perfect balance of art, creativity and logic with programming concepts mixed in.
I introduced Python, then Javascript, after he asked me about what I do (I was excited that he actually asked, so I ordered the book). I'm more of a web designer/developer, not a software engineer, so I showed him to the tools I know (trying to keep things at his level) and set him on his way. The thought of being able to write his own video game keeps him motivated. He plays with the examples on phaser.io/examples and sees it as something he might be able to do after working through the lessons.
My biggest concern is pushing him into something that he doesn't want for himself. It should never feel like work. He likes the CodeSchool videos, jingles and exercises, so he does it. He got tired of the books, so he stopped. There are many long gaps, diversions and pivots, which is totally fine. If he just wants to play outside, build with Legos, read, watch a movie or do nothing, I don't bother him. Programming is not his job, it's just a skill that I think will be useful for him and is something I can actually help him with.
Side Note: I originally had a section in the post about how in the past it was more common to pass knowledge and skills down to your children in the form of trades (farming, sewing, blacksmithing, etc.) and is "computer programming" something worthy of passing down. I thought it digressed a bit too much, so I removed it.
http://www.nicolasbize.com/blog/30-years-later-qbasic-is-sti...
Hacker News discussion:
As long as the kid is fine with JS I see no problem. If GOTOs haven't rotten our minds (or have they? omg!) maybe NaNNaNNaN Batman! won't mess up his...
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.
Same. When I was growing up, we had a Commodore 64 and a small collection of programming books. (For the youngens in the crowd: Back in the day, software would sometimes be distributed in print form and you had to type it all in). As I learned to read, I also learned to type code (starting around age 5 or so). Likely one of the first chapter books I really spent time with was the C64 manual: http://www.commodore.ca/commodore-manuals/commodore-64-users...
I also didn't know how to fix errors, so any time I made a mistake I would have to retype it all. By default, on a C64 you can just start typing a Basic program and then type RUN to run it. So you'd enter something like:
10 POKE 53280,2
20 POKE 53281,5
30 PRINT "CHRISTMAS!"
Then type RUN and it would run the commands. In the case of the above code, it would set the border of the screen to red, the background to green, and print CHRISTMAS! on the screen.> "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!"
I think this is correct. My son has spent a fair amount of type with the faux-programming stuff they have for kids these days (Tynker, code.org, etc) and has enjoyed it, but I've been struggling to find a way to transition him to something more real without it feeling forced.
At Windows Batch files.
Then introduce Ruby, it seems to have a pretty good binding for Windows stuff
I started with a really small BASIC for learning, after a bit I started messing with bash (my father used Linux, so I used Linux), and made some godawful scripts.
I was around 11 at that point, so most of my work was in a "choose your own adventure" text game where I also experimented with making a UI in the terminal with text. Then when I couldn't get it to run fast enough, started messing with C which I heard was faster, then picked up Java because I wanted to make a real UI (not a single one of the books on programming talked about any ways of getting a UI with C or C++), and from there to web languages because I wanted to build a website, and that launched my career.
Each step I hit a wall and struggled on my own for a while, and I think that was the most important part. I needed a solution, and that drove my will to learn. My dad only ever stepped in when I specifically asked, and even then he'd only get me a book/resource or give me some hints or very light help.
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.
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
[2]: https://www.khanacademy.org/computing/computer-programming
The author of this article nails it: there's nothing quite as motivating as adding "Poop" to the title of a real web page. Also, you can Inspect Element and get what is effectively an IDE. Is JavaScript the best language? No, it's inconsistent and confusing. But, so is English, and a lot of people learn English first - because it is practical to do so.
Another option that can be useful are Google Sheets. If they are a certain type of kid, they might like logging all of their toys in a spreadsheet and finding the total of the toys and making charts. Of course, most kids will find this boring... but you can also use Google Scripts to do something like scrape a subreddit and store it in Drive [1], which could be fun.
However, why not start with Scratch, or Snap! [2]? They are powerful enough (especially Snap!, I think you can define new data types in it...) and so much less intimidating.
[1] http://ctrlq.org/code/19600-reddit-scraper-script [2] http://snap.berkeley.edu/
That matches my intuition. But the word "fun" brought back to my mind this epigram by Alan Perlis:
> It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical?
Unless I have completely misunderstood this epigram, I think the point is that programming, when done well, is not fun; it's work. So maybe if we try to make programming fun so we can teach it to a child, we're setting bad expectations for what it will be like if they pursue it seriously.
So I guess that means that when teaching programming to someone of any age, we do need to focus on fundamentals and the things that Perlis mentions in that epigram. Then, if a 10-year-old kid loses interest, we should just let it go.
Makes me wonder if I and other self-taught programmers of my generation (I was born in 1980) built our careers on a bad foundation. I started learning to program in BASIC on my family's home computer when I was 8 years old, because when just dabbling in BASIC, it was fun. Even tinkering with assembly language was fun. But the important thing to note is that as far as I can recall, I produced only one truly worthwhile program as a pre-teen, and that was one that a relative asked me to write. And that was a serious project, not a diversion (AFAIK, the latter is the definition of fun, as is apparent from some languages like Spanish).
As for Perlis's jab at "modern education", I suppose the take-away is that we need to teach kids early that life isn't fun, rather than trying to make everything fun for them.
This isn't to say that such resources don't exist, but the fact that Javascript is the language of the web will simply make it impossibly difficult to follow a nice coherent pattern and you/the child will instead inevitably slowly drift to other things, and the risk is moving onto other concepts before the necessary scaffolding is in place and before they have a firm grasp of basic programming principles. Since the "web" is right there, it will be hard to fight the urge to start to do "engineering" while the focus should be on basic cs and programming concepts.
My advice (former school administrator) therefore is to teach programming to a kid using a canonical resource that they can use as a bible, but one also that will give them the freedom to build interesting things that they can share with others. I think Matthias Felleisen's HTDP is a fantastic book. You simply can't beat it when it comes to talking about patterns, design recipes, and overall how to test and think about an algorithm. And while the syntax may be challenging at first, functional programming and LISP in general actually offers less of a mental leap for kids who are used to algebraic expressions and function composition.
If this is a gifted 10-yr old, HTDP with some adult guidance will offer you the best bang for your buck long term. Some of the projects at the end even involve networked games, so there will be plenty there to motivate a hungry youngster.
EDIT: I forgot to add this: I mentioned that the syntax is challenging to kids at first BECAUSE there are so few rules, there is quite a bit they have to keep in their head as they write even very simple programs. You have to very quickly internalize the idea of function composition or else you are stuck, and that may be challenging for a young child at the beginning. But, at the same time, I think this is also a huge STRENGTH of the syntax. If he/she isn't getting this, it is pretty obvious and you simply cannot go anywhere until this happens, which isn't necessarily a bad thing. And, once they grasp this concept, then it is actually extremely easy because there aren't really any other syntactical rules to memorize and keep in order! This did require a lot of focus of kids, but I think there was something reassuring in the fact that they felt confident they understood all of the necessary principles of how the language was working, and that if they experienced issues, it was either in their own logic or in chasing some rogue parens. YMMV
Therefore, my advice to begin with a single canonical resource is that this increases the likelihood that someone's introduction to this stuff will be coherent and well-reasoned, and will introduce him/her to solid fundamentals. As someone who has been involved with teaching kids and coding, it is unfortunately very much the norm that "coding" classes devolve quickly into copy and paste exercises, and the reason for that is that is that kids' gap in understanding ends up simply being replaced by pattern-matching.
With programming, you have so many competing motivations/factors -- what you want to build, what you are learning, why you are building/learning, etc. -- that it becomes quite challenging to juggle everything coherently. I've always favored a single canonical resource to start because, more than anything, it is a way to drown out that noise. If you pick a good book, there is a rationale behind the order topics are introduced and there is reason to the increasing complexity and difficulty of the exercises presented in the book. If you hop around doing different things, you massively increase the chance that there is some basic concept you won't learn and that you will start creating an improper mental model of how things work. And, without this canonical resource, you may have a really hard time seeing that the reason you are struggling is because you lack some basic understanding.
So, I agree with you that there are no jobs worth having where a "bible" is provided; but I think that a learner -- and especially a novice learner -- greatly benefits from a resource like that to ensure that they have solid fundamentals onto which they can then graft other knowledge they seek out themselves.
I was a copy and paste web-developer for a while and it got me by but just barely. At some point, I discovered Michael Hartl's Rails tutorial. Rails was pretty foreign to me compared to the basic HTML/JavaScript stuff I was doing but I found it interesting and gave me the opportunity to learn web development from first principles.
Learning Rails in that environment made me a much more thoughtful and deliberate developer. All my applications since, even though they aren't in Rails, have benefited from that experience.
I have had personal experience with being commissioned to write a comprehensive resource for work. It is really a futile task in a lot of cases. Things change so quickly that they are different before, during, and after the writing and editing process. This does allow for the room for the learner to fill in the gaps and develop critical thinking and discretionary skills.
I think I was seeing this as too black and white when there are many shades of gray.
Once again, thanks for the education.
It allows you to easily create GUI applications and I assume thats what's interesting. Switching to other languages is easy enough, but capturing interest is key.
Or are there specific language misfeatures that you think get in the way of learning?
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.
The real trip up with javascript I often see even in professionals is asynchronicitiy, since JavaScript has a run loop.
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.
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
That's why we made text based games and an tkinter based RPG game at a coding bootcamp where I do mentoring.
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.
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.
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.
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.
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?
(Downvote me all you want... :P )
Please keep us posted about what your kid is building next.
Maybe NAND to Tetris.
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.
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!
I could argue that is much easier to write something functional in Go than it is to do the same in Javascript, because the compiler conducts you since the beginning and you can actually get around with Stack Overflow and Google.
Javascript requires a lot more experience, because it can fail in so many ways, it has callbacks everywhere etc.
That's ~88 A4 sheets when printed.
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.
I'm not sure what would make you think I'm trolling, because I'm not. Go was the only language I genuinely knew had a spec on a single page, and I thought other languages don't do that because it's not feasible (and the reason Go can do it is because it's much simpler and has a lot less features).
Now it's interesting to be able to compare the size of the two specs.
Heck, why does this surprise you in the first place? Why do you think it's called ECMAscript?
Disclaimer: you will need a login to see the whole thing.
IIRC, it's about 7 or 8 pages in the printed book.