How to get started with programming

Start out with HTML, CSS and Javascript. This will allow you to write programs that can run in your web browser. See jacobobryant.com/ball.html for a simple example of something you can do with the three languages.

HTML and CSS aren’t actually programming languages, but you can use them to create user interfaces for the programs you write in Javascript. You’ll use HTML to define the structure of the interface while CSS defines how that interface looks. You’ll use Javascript to write the actual program that does something (hopefully) interesting.

In my ball.html program, the HTML says that there should be an area to draw graphics on (called a canvas) and that there should be a bit of text that says “Use the arrow keys to move the ball.” The CSS says that the canvas should have a border around it and that the text should be at the top left of the screen, on top of the canvas. The Javascript controls the ball.

If you view the page source (if you’re using Chrome, go to ball.html and then hit Control-U), you’ll find this bit of code about halfway down:

function update() {
  resize_canvas();
  gravity();
  thrust();
  friction();
  move();
  collision();
  draw();
}

This code is ran every 15 milliseconds. It takes the ball’s current position and velocity and then simulates gravity, user input and friction to calculate where the ball should be next. If the ball collides with a wall, it’ll handle that too.

There are many online tutorials for learning these languages. Here’s one that looks good to me.

I also have a partially completed course for learning Python.