flashing ticker
To interact with this page you must login.      Signup

What is the best way to teach my 12-year-old son programming, preferably JavaScript?
spacer
categorytechnology
typeadvice
tynamite
tynamite's avatar I'm a web developer who knows php, and a bit of C and Ruby. I am familiar with Ruby on Rails. I know little actionscript (Flash).

I have coded a battleships game, a remotely hosted shopping cart, a large mysql database importer, a webhost billing script, a link sharing site with rails, and an incomplete platform flash game.

The one thing I do not know is javascript. Why? Because it's hard.
Javascript is for hackers. It's for people who not only can understand something, but can take it apart and find better uses to implement a technology.

It's all very well learning about the javascript syntax, about variables, loops, functions etc; but when it comes down to making javascript plugins for websites, such as image galleries, the sort of stuff you see on Dynamic Drive, how on earth do you do that?

Javascript is poorly documented. W3Schools and Pixel2Life is out of date and doesn't contain HTML5 specific javascript. MDN (Mozilla Developer Network), tries to solve that problem by having a function reference, but that doesn't do much to help one learn it. HTML5Rocks barely helps.

Javascript is an acquired thing to learn. You learn it by copying other people's javascript, finding out how it works, using Google, and thinking like a hacker, and not a php coder who simply manipulates information in a mysql database or a string.

Here's a challenge for you. Four years ago, I never knew that javascript frameworks like JQuery existed. I wanted content on a page to change when I clicked an image. I didn't know how to do it. Dynamic Drive failed me. I searched Google for 2 hours to find a javascript script that would hide or show a div based on a click. I was searching for a a javascript gallery plugin, and JQuery did not come up in the search results. Now I have the code, I know how the javascript works, and can modify it and mash it up with other javascript. I challenge you to do the same thing that I did. See how easy it is.

Here's a 2nd challenge. Look online for how to do code something hypothetically. I've got the real code for it from a magazine so it's not online. Use Google. There's a javascript you can use to make a div play and pause a HTML5 video? It doesn't use plugins like JW Player, for frameworks like JQuery or Prototype, and it allows you to style the controls for HTML5 video. It does the following things in order.



  • Check for HTML video support
  • Get all the video containers on the page
  • Gets every single instance and create a [video] tag, and a play and mute button. It should get and create all video elements, and turn off native controls.
  • Make sure the play pause button toggles.
  • Make sure the mute button toggles.
  • Add custom controls to the video controller
  • Initalise function on page load.



You can use CSS3 to style the [video] if you wish.

Javascript is for hackers. It's coding on another level, and I don't mean that by saying it's hard. The javascript syntax (code) looks just like C, php, ruby and every other code.
report this post permalink
What's an assertion, and what should I type in?

Compesh is a question and answer (and debate) website, so before you make a debate, you better learn what an assertion is. I suppose you already know what a question is, and that you've typed it in the box. ;)

An assertion, is basically a statement you can make, that is either true or false.

Richer people have better health.

The question for that would be, Do richer people have better health?

And don't forget to make your assertion, match your question.

Compesh logo