Monthly Schedule

(Introduction to Programming Languages, Period D)

W 1/19/011

First day of class. Introductions, definition of natural language and programming language, overview of 1GL, 2GL, 3GL.

 

Th 1/20/011

Pop quiz on yesterday’s class discussion. Compilers vs. interpreters. Code generators (4GL) and beyond. AND, OR, and NOT gates. Implications and the symbols  Debugging and maintenance programming. Why bifurcated program maintenance is a bad idea.

 

F 1/21/011

HW due: Send Mr. Hansen an e-mail containing your name (first and last name). Mr. Hansen’s contact information is here.

In class: The importance of backup copies, version control, naming conventions, and change management. New terminology: requirements creep, regression testing, function (Excel function), arguments.

 

M 1/24/011

HW due: Read the 3GL candidate descriptions and the IPL “big idea” below, and come to class prepared to vote. It will be a shorter-than-usual class, but please try to arrive on time. If a 3GL that you would like to study is not on the list, you may nominate it from the floor and make a short speech to campaign for votes.

 

Java        Guaranteed winner. We will automatically put Java on the list of 3GLs to study, since one of the purposes of the IPL class is to prepare you for AP Computer Science, a Java-based class.

 

C             C is, among other things, the language of Unix. C is extremely widespread and has compilers for all platforms. A good choice.

 

C++        Similar to C, but with object-oriented extensions. Less appropriate for an introductory class, but if a lot of people want to study C++, we can do it.

 

Pascal    An excellent teaching language, though much less widespread than C in the real world.

 

VBA       Has a huge advantage of being widely available (without any download or installation) on most Windows machines. Easy to learn and use. Programs you write in VBA can automate many of the tasks you or your parents might typically want to accomplish in Microsoft Word or Excel, for example. Disadvantage: Proprietary Microsoft product. Note that we would study VBA (Visual Basic for Applications) instead of plain VB (Visual Basic), since VB would bog us down with a lot of tedious licensing issues. Any Windows machine that has Word or Excel on it already has VBA, ready to go.

 

Lisp        A completely different sort of language, but a lot of fun to learn. Used mainly in artificial intelligence. Lisp makes no distinction between program code and data, which is an astonishing thing if you think about it! Thus programs can modify themselves or other programs. Lisp has been around for more than 50 years and is the second oldest 3GL that is still in common use today.

 

Fortran  Easy to learn, important as a scientific programming language. Fortran (1957) is the world’s oldest 3GL that is still in common use today. If you are thinking of becoming an engineer, you will probably have to work with Fortran code at some point.

 

Python   Extremely popular modern language. Runs on all platforms. Generally interpreted, not compiled. Much easier to read than C.

 

SML       Popular teaching language, but probably more suitable for a college-level introductory class. SML stands for “Standard ML,” and ML stands for metalanguage. Just as “metaknowledge” means “knowledge about what you know,” the term metalanguage refers to a language that can be used to describe or define other languages. Therefore, SML is useful in writing other languages. For example, if you wanted to write your own compiler for your own made-up 3GL, SML would help you do that.

 

Prolog    Modern language especially well suited to natural language processing, GUI (graphical user interface) development, and artificial intelligence.

 

Here is how the voting will work. After we have a final list of candidates (including nominations from the floor, if any), we will vote by secret ballot for up to 5. In other words, you will put a check mark next to the names of any 5 (or fewer) languages that you wish to vote for. You will also be permitted to place a double check mark (double vote) for 1 or 2 of the languages that you support especially strongly. Mr. Hansen will also vote, and his vote will carry a little more weight than anyone else’s. At the end, all results will be tallied, and the winners will be Java and 2 or 3 others.

 

The more languages you can become “a little bit acquainted with,” the smarter you will be. However, we need to balance the breadth of exposure with the desire to learn some practical details in each language. Therefore, we will limit ourselves in IPL to learning only 3 or 4 languages (Java plus 2 or 3 others).

 

The Big Idea of IPL

 

What is the central idea of IPL? Here it is, and I recommend you learn it, since it is really important: If you have an idea for an app, you can write your app in almost any 3GL designed for general-purpose programming, though some languages are much easier for certain purposes than others. You can learn additional languages by taking classes, or better yet, by teaching yourself a new language every so often as you grow older.

 

T 1/25/011

HW due: Download the PDF version of the Green Tea online Java textbook to your computer, and then read the following pages:

 

  • Preface (pp. v-ix). Skimming is acceptable in this portion of the text.
  • Read pp. 1-7 carefully. Reading notes are expected. (You can stop reading in the middle of p. 7, at the beginning of §1.5.) See the HW guidelines for more information.

 

W 1/26/011

Double Quiz (20 pts.) will be based on the reading assignment from yesterday, plus all classroom discussion up to this point.

HW due: Read over the following BASIC program and predict its output. In class, we will enter the program into Smokey and see if your prediction is correct. Make some written notes indicating how the contents of variables A, B, and C are initialized and changed.

10 CLS ' this line clears the screen
15 LET A=15 : LET B=20 : LET C=30
20 FOR I=1 TO 4
30  A=A+B+C
40  LET B=B+1
45  IF B>22 THEN C=B ELSE C=C+1
50  FOR J=1 to 1250 : LET B=B : NEXT J ' this is a timing loop (simply wastes time)
60  BEEP
70 NEXT I
80 PRINT A

As we discussed in class, a single quotation mark ( ' ) indicates a comment in VBA and in older versions of BASIC as well. The colon ( : ) is used in BASIC to place multiple logical lines on a single physical line.

BASIC originally stood for “Beginner’s All-purpose Symbolic Instruction Code” because it is so easy to read. However, except for Visual Basic and its cousin, VBA, the language is rarely used nowadays.

The equal sign ( = ) in BASIC means to assign the value on the right to the variable on the left. Therefore, even though B=B+1 makes no sense in algebra, it makes perfect sense in BASIC. The instruction B=B+1 says to take the right-hand side (namely, 1 more than the current value of B) and assign it to variable B, which has the effect of increasing B by 1.

Finally, the word LET is optional. In other words, LET B=B+1 has exactly the same function as B=B+1. “Advanced” BASIC programmers always omit the word LET in order to avoid wasting time.

 

Th 1/27/011

Snow day (no school). The original plan was to post an additional assignment for you to work on for Friday. However, because so many students are without power, there is no additional assignment. The assignment originally due today (Thursday) has simply been moved, unchanged, to Friday.

To repeat: There is homework due Friday, but it is the same as the assignment that was already made for Thursday. If you have trouble doing the assignment, you are expected to “phone a friend,” consult the Internet, or call Mr. Hansen at 703-599-6624. Mr. Hansen will not be going anywhere until Thursday evening at the earliest.

 

F 1/28/011

HW due: Read through p. 12 in the textbook, paying special attention to the glossary (§1.6); rewrite your assignment from Wednesday (see “archives” link above) so that it clearly shows the values of A, B, and C during each of the 4 loops, and also write Exercise 1.1 on p. 10 of the textbook. Reading notes are required, as always. For full credit, your homework must be on filler paper in a 3-ring binder, with your name and date formatted as shown in the HW guidelines.

In Exercise 1.1(c), the word “executable” is pronounced with the accent on the third syllable: exe“CUTE”able.

Another 10-point quiz is possible during class, but this time it will cover only the glossary (§1.6).

 

M 1/31/011

No class.

 

 


Return to the IPL Zone

Return to Mr. Hansen’s home page

Return to Mathematics Department home page

Return to St. Albans home page

Last updated: 02 Feb 2011