Chapter 8: Tower of Babel

Chapter 8: Tower of Babel

Chapter 9: Tower of Babel:

Programming languages as we know it today are all procedural languages following the Von Neumann architecture of sequential operation. The languages differ in the syntax, how the code is written per line and how the variables are named. However, the idea of developing a program in any of the languages that exist today is basically the same. That is an algorithm developed to solve a problem could be taken and transferred into virtually any of the programming languages that exist. It must be known however, that some programming language were developed for specific purpose (even though their use may be extended), whereas others like C++ are more general-purpose languages.

FORTRAN:

Only a few persons were capable of writing programs, using assembly language, so in the mid-50’s, a new language was developed – Fortran. Most of those early programmers were scientist and/or engineers who needed an easier way to write programs. Fortran was born. It is really a language more suited for scientific calculations. However, a large program would have too many GOTO statements leading to what is known as “spaghetti code”. There were no capabilities for explicit looping (using the while loop) and comparing values were involved, among others. Nevertheless, Fortran has remained one of the most popular languages for engineering purpose even up to today. The language itself has gone through many over-haul thus making it more “modern”. Fortran was released for the first time in 1957, making it the first true high level language, thereby relegating Assembly Language to thereafter be regarded as a low-level language (not machine language).

COBOL:

Following Fortran was COBOL (Common Business-Oriented Language) developed in 59-60, by the US Navy headed by Grace Hopper. The idea was that Fortran could only be used for scientific purposes so why not get a language for business purposes. Cobol served that purpose. It was used mainly to keep databases up to date and to generate reports. Cobol programs look very much like English sentences – the idea was that they did not want to incorporate many formulas, etc. so that the programmers did not have to be as highly skilled as Fortran programmers are. But because of its simplicity and the growing business world, Cobol was and to some extent is still one of the most (if not the most) used programming language today. However, when programs were written 30, 20 years ago, nobody thought that they would still be used today (with minor modifications of course) so to save space, many of the dates were using 2 digits only. Thus the Y2K problem. Millions of lines of code have dates expressed in 2 digits with the 19 being sort of default. However, with the advent of the new century, a two-digit date could be interpreted as 20.. or 19.., thus the problem.

PASCAL:

Pascal was developed in the early 70’s by Prof. Wirth, mainly as a language for teaching purposes. It was the first language that got rid of the GO TO statements form Fortran, even though the capability still exist in the language. It is not a huge language, and thus could be learned in its entirety rather quickly. It is hardly ever used for industrial of business programming, but it does expose potential programmer to better programming than Fortran and Cobol. The spin off of Pascal is Modula (various versions) and it was also used as the core programming language in Delphi to enable the incorporation of windows-based programming with a GUI environment.

C.

C was also developed in the early 70’s by Dennis Ritchie at AT&T. It was originally developed for system programming, particularly UNIX. C is a sort of two-fold language wrapped in one. It provides the high level programming environment that is available in other high level languages thus making programming easier as well as the ability to incorporate low level constructs to directly access memory addresses, etc. thus speeding up execution. And we need an operating system to be fast. This concept is achieved through pointers and referencing (using * for pointers and & for referencing). For example if money is a variable with a value of 500, then &money would provide the address in memory where money is stored, and not the value of money (500 in this case). To extract or obtain the value of money we either use money or *money (this last construct known as de-referencing). C (and now C++) is fact the language used to develop most of the operating systems that are available today. Note: C++ derived from C but with much more features added including the capability to enable OOP.

ADA:

Ada was developed to meet the needs of the armed services of the USA. In 1979, the language was chosen from others to be used by the military. It is a huge language (like C++) and is now not only used by the military, but also other establishments

as well as for teaching. It is truly a general-purpose language (like C and C++). It offers the ability for concurrent programming as well as OOP. The syntax is very similar to that of Pascal and C.

Object-Oriented Programming (OOP):

In OOP, a different view to programming is taken. Rather than writing a program with a flow, statement after statement in a top-down approach, as with Pascal, C, etc. the program is divided into tasks and subtasks. Objects are defined, and these objects are treated as separate entities that may or may not interact with each other to produce a result. The objects are given their own attributes, as in real life situation. The idea is that each object should be able to do its own thing (the I-can-do-it-myself concept). Also, with the cost of developing software increasing ever higher, the idea of “do not re-invent the wheel” is of paramount importance. The idea is, if you could develop code and somehow store that could to be reused at some future date, then you do not have to rewrite the code. Thus, libraries are developed and attached with the compilers. Another

important aspect is that when you write a program, you will use variables. Sometimes these variables are accidentally overwritten or lost. By using OOP, you can hide these variables thus they would be harder to change or be lost. The following diagram gives three important aspects of OOP that sets it apart from other languages – inheritance, encapsulation and polymorphism.

Encapsulation: each class has its own modules associated with it. A class interface is declared and could be seen by the user (the main program or another class). All of the details of the class are hidden – including the variables and modules. This declaration has basically three parts – a public part, a private part and a protected part. These are used to either hide the variables and modules or provide them to the user. By doing this, not only the data, etc. are hidden from the outside world, but if a module needs to be changed, it could be done within the class without affecting other parts of the program.

Inheritance: A base (parent) class could be defined and a derived (child) class created from the base class. The base class would have general characteristics of the object and the child class will have specific characteristics of that child. An example of a base class could be furniture and a child class could be tables and a child class of tables could be coffee tables.

Polymorphism: objects should be able to do different things even though they may have the same name. Example, when sorting an array of integer numbers, we use a sorting routine which consist of swapping. The swapping could be written separately as a routine and then called inside of the sort routine to perform its job. However, when swapping we need to provide parameters. If it is an integer array, we need to provide integer parameters. But we may want to swap double, characters or strings. We would therefore need to write different routines for each of these. But we could write one swap routine to take care of any of the situation. We only need to create a template (a sort of library) and call the routine via the library and the data type. Analogous with this is virtual functions.

Languages are also developed for very specialized tasks – some examples are SQL, Pearl, HTML.

SQL (Structured Query Language) is a database language. It enables the programmer and user to manipulate databases – creating, modifying, and deleting databases. It also enables report generation. It is perhaps the most widely used database language in the world. There are many flavors of SQL – for MSAccess, Oracle, etc. It could be embedded in HTML documents, making those documents dynamic. It could be embedded in JAVA, C++ all to do database manipulation.

Pearl (Practical Extraction and Report Language) is also used with databases similar to SQL. Furthermore, it could be used UNIX systems to help creating shells.

HTML (Hypertext Markup Language) used basically to create static web pages. But incorporation of JAVA Script or VBScript or Pearl or SQL can make it dynamic and thus provide multimedia capabilities.

1