Week 1 Notes - Chapter 3 - Introduction to Straignt-Line Programs

The Ages of Programming Languages

First, a review of the various "ages" of programming languages:

  1. The Age of Chaos - These were the bad old days of assembly language, BASIC, early FORTRAN, and *shudder* COBOL. Variables, statements, and GOTO-style control structures were scattered higgledy-piggledy through countless lines of indecipherable spaghetti code. Nobody really misses these days very much.
  2. The Age of Structures - A quantum improvement was achieved with the arrival of structured programming languages like Pascal, C, and Fortran77. The philosophy here was this: Put your lines of code into blocks which are prefixed with declarations that describe what the block does: i.e. if for conditional blocks, while for looping blocks, for as a label for iterative blocks, and function as a label for subroutines, etc. This approach was even extended to collections of data types in the form of structs or records.
  3. The Age of Objects - A few shortcomings were realized in the structured approach: While code blocks were now organized, data (i.e. variables) and functions that acted on that data were still uncoupled. Moreover, in debugging environments, it was discovered that taking a procedural view of your programs, rather than a data-centric view let a lot of bugs slip by. Therefore, meta-structures were invented which could hold both variables, and functions which acted on those variables; such structures were given the identifiers class and package, among others.

Some Notable Object-Oriented Events in History

Bjarne Stroustrup introduced C++ with his extensions to the C compiler invented by Brian Kernighan and Dennis Ritchie. IBM made waves with their Smalltalk language that featured a very innovative approach to programming in an event-driven environment. In recent years, Sun introduced the world to Java which is a cleaned-up, platform-independant, strictly object-oriented revamp of C++. Borland has presented us with Delphi, which is a tidied-up and extended version of Object Pascal. Perl and Python have changed the way we think about scripting languages, as each of them has some nice OO features all its own. In 1995, the Ada language was revamped with bright, shiny object-oriented constructs and hardly anyone cared.

Somewhere along the line, LISP was introduced which has elements of all (and none) of those various ages.

On to Ada!

Overview of Ada Traits

Nice things about Ada:

Not-so-nice things about Ada:

Ada Syntax

Basic Syntax items:

Math Operators: (Section 3.6 starting on p. 83)

Formatting Output: (Section 3.7 starting on p. 86)

Data Types:

Afterword: Some Study Guidelines when Reading the Textbook

When you're reading the book here are some guidelines that will hopefully make your studying less time-consuming:

Assignment 1

Write the classic "hello world" program in Ada. It will simply display the text "hello world" on the console, followed by a newline. The purpose of this assignment is to make sure you know how to use the lab server, make sure your user account works, make sure you know how to use the compiler, etc. This assignment is due the night of the first midterm, September 26th.