Course Links
ICS3U Home
Course Outline
Units of Study
Time Line
Classrom Expectations
Acceptable Use Policy

General Resources
STH Google Apps

Java Help
Java Class Libraries
Help with Ready Classes
Java Style Guide
Sample Code
Sample Game Applet
Other Java Resources

School Links
IT Dept. Page
STH Home Page

Programming Style Guide

Here are a number of "rules" for good programming style. The purpose of a style guideline is to make your programs easier to understand. It is possible to write a program that does not follow these rules which will still run correctly. But by following an established set of style rules, your program will be easier for other programmers to read and (if necessary) to modify. It should also help you to understand your own program better, and perhaps help you fix problems in your code.

Note : All programs you write for this course must follow this style guide.

    • A "comment block" is included at the top of the program, which includesthe following information:
      • The name of the program
      • a short description of what the program does
      • the author's name
      • the date the program was written
    • Internal comments are used inside the program to explain the logic of the program
  2. Variables
    • Use meaningful variable names that relect the data they store.
    • Use the correct data type.
    • Always name variable starting with a lowercase letter. Use "interCap" style of naming variables that require compound words (like firstName), or use underscores (like first_name).
  3. Indenting
    • Use F2 in Ready to paragraph your code.
  4. Use of white space
    • Leave a single blank line between methods, and major sections of code. Don't leave multiple blank lines (That's just wasting space!).