Home > Articles > Programming

  • Print
  • + Share This
This chapter is from the book

Your First Program

The first program that you write will be simple. You may not understand much of it, and that’s fine. The goal here is not to explain the program details, but to walk you through the entire process of the steps that are typical of computer programming:

  1. Type a program’s source code and save it.
  2. Load the code document, which is now an HTML document saved to your hard drive, with your web browser and see what happens.
  3. If the page is not doing what you want and has errors, called bugs, you’ll need to fix those bugs in your source code and repeat these steps. Hour 7, “Debugging Tools,” explains how to locate and fix common bugs. You may need to do some bug hunting earlier than Hour 7 if you experience problems with your programs in these first few hours. If a program does not work as described, you will need to compare your source code very carefully to the code in the book and fix any discrepancies before saving it again.

Starting with JavaScript

You can write your JavaScript code in either your text editor or a word processor. If you choose the latter, you must make sure to save your files as text only. Save your programs with an .html extension, and then when you double click on the file, it should automatically open with your default web browser.

  • + Share This
  • 🔖 Save To Your Account