
Other Computing Languages
Although the Comp 106 course uses the C++ language for programming, the basic programming
ideas can be readily generalized to other programming languages. In particular, there is very little
difference between the C++ language elements learned in a beginning C++ course and the
similar elements in C. The main difference is the input/output functions. Different functions are
used in C. Libraries such as iostream and fstream (and the corresponding input and output
techniques, using cin, cout, and their equivalents for file input and output, are not used in C.
Instead the output routines are contained in a library known as stdlib.h and those routines have a
completely different form. Also, the C language does not have classes or references. Passing
variables by reference is a bit more complex in C. However the basic structures of if statements,
for loops, while loops and case statements is the same in C as it is in C++.
The attached table shows a variety of basic statements in several higher level languages. This
table illustrates the similarities and differences among the various languages. The main similarity
is that the basic control structures for choice and looping exist in all languages. All languages
require the specification of the data types for the individual variables and the declaration of
arrays. No object-oriented commands are included here.
The differences lie in the syntax that each language uses. Programmers who are familiar with
one language will usually not have any difficulty reading programs in another language.
However, it is easier to write code in the language that you use most frequently. Coding in a
language that a programmer uses only infrequently will be time consuming because the
programmer will not be intimately familiar with all the syntactical details of the language.
The languages that are compared on the following table are listed below:
C/C++ C++ is the language used in this course and is a major programming language in
use today for engineering and computer science applications, particularly in
computer operating systems and graphical user interfaces. C is used in programs
for some firmware devices.
Java Java is similar to C++; it is intended to be a platform-independent language for
use in internet browser applications.
Fortran 95 Fortran was the first higher-level language and is still widely used in large scale
numerical analysis programs for engineering systems.
Visual Basic Basic was intended to be a simple language for instruction in computer
programming. Visual Basic, by Microsoft, has become an important language for
user interfaces and as the macro language in Microsoft programs such as Excel.
Ada The U. S. Department of Defense developed this high-level language for a wide
range of applications including simulation programs and real-time computer
systems.
Pascal This was designed as a simple higher-level language to illustrate the basic
programming constructs. It once had wide use in education.