Previous Page TOC Next Page



1. Introduction

1.1 What is Blue?

Blue is an object-oriented programming language especially designed for teaching. Its emphasis is on conceptual clarity and consistency, suitability for first year teaching and support for "good" software design.

1.2 The Blue Environment

Blue is intended to be used in an integrated programming environment. The environment itself will not be described in this document, but is important for the overall character of Blue programming. In order to obtain a complete picture of programming in Blue, the reader is encouraged also to read "The Blue Programming Environment" [1].

1.3 About this Document

This document describes the Blue language. The Blue programming language is part of the Blue programming system. The language and some of the most important standard libraries (such as those for standard I/O) will be described in this document. However, most standard libraries will not be included here, but will be described in a separate document "The Blue Libraries" [2].

It is assumed that the reader is familiar with a Pascal- or C-like language and with object-oriented concepts. This document does not give an introduction to object-oriented programming in general. It is assumed that the most basic ideas of object-orientation are known.

At some points this document also includes thoughts and reasoning beyond pure description of the language. These comments typically include reasons for specific decisions made during language design. They may be skipped by readers interested only in the language, or read by someone interested in the design process itself.

Comments about reasons for specific design decisions are set in greyed boxes like this and may be skipped without losing information about the Blue language.

Descriptions of language constructs always include a formal syntax description in EBNF. A complete syntax description in EBNF can be found in Appendix A.

1.4 Blue Programming

Blue does not include a concept of programs. All programming is performed using classes. All code is part of a class. The classical idea of a program is represented in Blue as a collection of classes (called a project in Blue). Running a program is done by creating an instance of a class, and calling interface routines of that class.

A simulation of a classical "program" (a single entry point executable) can easily be achieved by having one designated top-level object with one interface routine which in turn creates and calls all other objects involved in the execution of the program. (This is the standard execution model in most existing object-oriented languages.) It is, however, only a small subset of the possible ways to execute code in Blue.

In the Blue environment, all classes in the project may be used to interactively create objects of that class and all those objects can immediately be used to call their interface routines (that is: without the necessity of writing test program shells). This changes programming in at least two ways: it allows very flexible (incremental) testing and incremental software development. All low level classes may immediately be used and tested for correct behaviour. It also allows the construction of software with more than one entry point, avoiding common awkward dispatch mechanisms envoked by command line options.

Classes are types [ It is not strictly true that classes and types are the same, but most of the time each class represents exactly one type. This is not true when it comes to generic classes (which do not represent a type, but rather a type pattern ). The difference will be explained in detail in section 17. For most of this document, however, this simplification is not a problem and makes expressing things a bit easier.] . So all programming comes down to the definition of types. This is why type declarations are the first major part of this document: They specify the overall structure of Blue programs.

Previous Page TOC Next Page