In order for computers to accept commands from humans and perform tasks vital to productivity and e-commerce, a means of communication must exist. Programming languages provide this necessary link between man and machine. Because they are quite simple compared to human language, rarely containing more than few hundred distinct words, programming languages must contain very specific instructions. There are more than 2,000 different programming languages in existence, although most programs are written in one of several popular languages, like BASIC,
COBOL, C++, or Java. Programming languages have different strengths and weaknesses.
Depending on the kind of program being written, the computer will run on, the experience of the programmer, and the way, in which the program will be used, the suitability of one programming language over another will vary.
When people refer to programming languages, they normally mean one of many different kinds of high-level languages or fourth-generation languages that reside above the level of assembly language. Unlike machine and assembly languages, high-level languages resemble human grammar and syntax more closely, and are often portable to different operating systems and machines. Three programming languages were instrumental in opening the lines of communication between programmers and computers. FORTRAN, COBOL, and ALGOL were created around the 1950s and many variations of these languages were still in use during the early 2000s.
A programming language is a set of words, codes, and symbols that allow a programmer to give instructions to the computer. Many programming languages exist, each with their own rules, or syntax, for writing these instructions.
Programming languages can be classified as low-level and high-level languages. Low-level programming languages include machine language and assembly language. Machine language, which is referred to as a first generation programming language, can be used to communicate directly with the computer. However, it is difficult to program in machine language because the language consists of 0s and 1s to represent the status of a switch (0 for off and 1 for on).
Assembly language uses the same instructions and structure as machine language but the programmer is able to use meaningful names or abbreviations instead of numbers. Assembly language is referred to as a second generation programming language. High-level programming languages, are often referred to as third generation programming languages (3GL), were first developed in the late 1950s. High-level programming languages have English-like instructions and are easier to use than machine language. High-level programming languages include
FORTRAN, C, BASIC, COBOL, and Pascal. In order for the computer to understand a program written in a high-level language, programmers convert the source code into machine language using a compiler or an interpreter. A compiler is a program that converts an entire program into machine code before the program is executed. An interpreter translates and executes an
Page 1 of 12
instruction before moving on to the next instruction in the program. Thus once a program is written in a high-level language, a program called a compiler or an interpreter is used to convert it to a computer's specific machine language, much like an assembler converts assembly code into machine language. A compiler translates an entire program into machine language. Once translated, a program can execute by itself. An interpreter reads your program source code and performs the operations specified without actually translating the code into machine language.
The interpreter program executes the program you create, so your program always requires the interpreter.
In the 1980s, object-oriented programming (OOP) evolved out of the need to better develop complex programs in a systematic, organized approach. The OOP approach allows programmers to create modules that can be used over and over again in a variety of programs. These modules contain code called classes, which group related data and actions. Properly designed classes encapsulate data to hide the implementation details, are versatile enough to be extended through inheritance, and give the programmer options through polymorphism.
Object-oriented languages include Java, C++ and Visual Basic.
Note:
1. Grace Murray Hopper
1906 – 1992
The first compiler, A-0, was created in 1951 by Grace Murray Hopper, a Commodore in the
Navy at the time. She is also credited with developing COBOL with the United States
Department of Defense in 1959. She later used the term “debug” when removing a moth that had flown into the circuitry of a Mark II computer.
2 . Credits
In 1957, John Backus and a team of researchers developed FORTRAN. In the 1960s, John
Kemeny and Thomas Kurtz developed BASIC at Dartmouth University. In the late 1970s, the
United States Department of Defense developed Ada, a high-level language that supports realtime applications. Also in the 1970s, the C programming language was created by Dennis Ritchie at Bell Laboratories
.
3 . Fourth and Fifth Generation Languages
Fourth generation languages (4GL), such as SQL, have higher English-like instructions than most high-level languages and are typically used to access databases. Fifth generation languages are used for artificial intelligence.
Programming Languages
Programming languages are the most basic tools for communicating with a computer. The reliability, usability and portability of any programming language depends mostly on the language features. Software engineers should have a fairly good knowledge on the comparative
Page 2 of 12
features of the various programming languages so that they can take reasonable decision regarding the suitability of a programming language for particular applications.
Hierarchy of Programming Languages
Programming languages form a hierarchy right from a machine language at the very lowest level to application oriented high level at the top. The programming languages for computers can be classified into three categories, namely, machine level programming, assembly level programming and high level programming languages.
Machine level programming
Assembly level programming
High level programming
The hierarchy of programming languages
We will concentrate mainly on High level programming languages.
High Level Languages
High level language programs resemble very much in structure to the English language. A single instruction in high level language can correspond to several instructions in the machine language.
Examples of high level languages are the following:
BASIC
C++
ALGOL PROLOG C
COBOL PL/1 LISP
FORTRAN
Java
Pascal PRG
The main advantages of using the high level languages include:
To develop programs using a high level language is much easier than using the assembly language
Programs developed by using high level languages will run on different types of computers as long as a translation program is available to convert the high level language source code to machine executable form.
Since the syntax and structure in a high level language is almost English like, they can be easily learned and understood by a beginner. Moreover, they are highly standardized
(machine independent) and therefore, programs written in these languages require little modifications for being executed on any other computer.
Page 3 of 12
In spite of several distinct advantages of high level languages over machine level or assembly level languages, there are a few demerits as follows:
Programs written in high level languages run too slowly for real time applications than programs that are developed using assembly or machine level languages.
Programs written in high level languages occupy too much memory for program storage
Comparison of low level and high level languages is carried out in the table below.
Indicators
Program development time Long
Programmers skill required High
Orientation Towards computers
Ease of modification
Speed of processing
Memory requirements
Portability of programs
Applications
Low level languages
Difficult
Very high
Minimum
Programs are confined to machine.
Operating Systems (OS)
Language processors and utilities
High level languages
Relatively short
Much lower
Towards humans
Very easy
Slower
Often significant
Can be moved between different types of computers
Application programs
Classification of Programming Languages
Designing, developing and using a programming language is always dynamic in nature and no particular programming languages have ever been under constant attraction to the programmers/users. Depending on the size of the program and its complexity, users prefer to choose their programming languages. It is well known that more than 2000 programming languages have been designed, developed and used till date for various purposes. But each language has drawn the attention of specific group of users and has been used for solving problems in scientific, business and engineering fields. In general, high level programming languages fall into any of the following categories:
Modular programming language
Structured programming language
Business oriented language
Mathematical oriented language
System programming language
Functional/logic programming language
Object oriented programming language
Visual programming language.
Salient features of some of the languages above are described below.
Page 4 of 12
Modular programming languages
Modular programming languages have been very influential in introducing certain fundamental concepts in contemporary programming languages. It is the first programming language that introduced subprogram concepts and variable declaration, etc. In real life situations, problems in scientific, engineering and business areas are usually large and complex. To solve the entire problem in one shot may not be a feasible option. Modular programming methodology advocates the breakdown structure approach of a large project into several smaller and manageable modules. Then each small module is programmed comfortably and then put together in order to generate program and hence the answer to the entire problem. Modular programming has several unique advantages as given below:
It is easier to understand
It is easier to code
It is easier to document
It is easier to modify
In order to implement each module in a programming language, subprograms are used. In programming parlance, a subprogram is a series of instructions that performs a particular task.
An example for the modular programming language is ALGOL. ALGOL stands for
ALGorithmic Oriented Language. ALGOL had its unique name and place among programmers in late 1960s. A notable feature of ALGOL was that it laid the foundation for many advanced programming languages of today and some of its salient features were embedded into new languages like Pascal and C. The general features of ALGOL include:
Block structured
Scope variables
Modular programming styles such as procedures and functions
Well suited for solving complex problems of scientific, engineering and business problems.
In spite of the above uniqueness, ALGOL was unable to compete and survive for a long period due to two reasons, namely,
1.
Introduction of new languages with much more advanced features than ALGOL.
2.
Non-availability of a standard ALGOL compiler and inadequate support from software vendors.
Page 5 of 12
Structured programming language
Since the early 1970s a new methodology has become very common in programming environments. This new methodology advocates GOTO programming. The very purpose is to eliminate the use of GOTO statements in programs. Proponents of this methodology believe that the GOTO statements make the program complex and difficult to debug or modify. In structured programming, four structures are normally used for performing any tasks. These include the following:
Sequence
Selection
Iteration
CASE structure
Sequence means going from step1 step2 and so on. There is no looping or branching involved.
Selection is used whenever choices are to be executed between two options. Iteration indicates a loop for performing a specific task. The CASE structure is used when there are more than two options from which one has to be selected based on the value of an expression. An example of the structured programming language is Pascal. It is a general purpose, high level programming language. It was designed by Nicklaus Wirth in 1964. The main motivation of designing and developing the above language was to teach the basic computer programming concepts in a systematic manner. Pascal was named in honour of Blaise Pascal, a French scientist, philosopher and writer of the seventeenth century. Pascal is not an acronym and hence it need not be written in uppercase letters. It gained immense popularity due to its simple, logical and natural principles that are based on the structured programming concepts. The main purpose of using Pascal is to implement the concept s of structured programming. The following are the salient features of
Pascal:
It is a block structured language in which blocks of statements can be used as a unit by control structures.
It relies on a very heavy use of subroutines which it calls as procedures and functions.
It also supports both local variables known and valid only within a procedure and global variables known and valid throughout a program.
The above three features allow a programmer to write Pascal programs in a top-down modular design.
An example for the business oriented language is COBOL. COBOL stands for COmmon
Business Oriented Language. It was introduced in the year 1959. Since then the language has been extensively used for commercial data processing. COBOL as a language is most verbose and English-like, making it easier to learn. Even though it was primarily designed for data handling and input and output operations, it can perform arithmetic operations as well, but with much lesser flexibility than data handling operations. Advantages of COBOL can be listed in the following points:
Page 6 of 12
COBOL programs can be easily understood even by non-programmers due to its self documenting nature and verbose of the grammar.
It is an ideal language for processing voluminous data files. Therefore it is an excellent language for commercial data processing.
Editing facility is very powerful and hence even the manipulation of non-numeric data is very easy.
COBOL is a universally standardized language.
It is best suited for time sharing computer systems.
It is easy to debug and maintain programs in COBOL.
It is one of the most structured languages.
COBOL provides scope for effective documentation.
One of the well known and commercially available logic programming languages is PROLOG which stands for PROgramming in LOGic. Main feature of PROLOG include:
It is exclusively meant for Artificial Intelligence (AI) and knowledge representation techniques.
It supports rule based expert systems and knowledge bases (data bases with inferential components).
It provides a foundation for understanding the semantics of other kinds of rules and is itself a good language for writing rule processors with various search strategies.
It is well suited for symbolic manipulation and information representation tasks.
Construction and extraction of data structures are the principal mechanism used in the computation processes of PROLOG.
A unique property is its level of abstraction.
Another example for the functional and logic programming language used in AI applications is the LISP. LISP stands for LISt Processing. LISP takes functions as arguments or return functions as results. It provides for defining functions that are based directly on the lambda-calculus. LISP is characterized by the following ideas:
Computing with symbolic expressions rather than with numbers.
Representing symbolic expressions and other information by list structure in the memory of a computer.
The use of lambda expression for naming functions.
Representation of LISP programs as LISP data that can be manipulated by other programs.
Conditional expression interpretation of Boolean connection and others.
Page 7 of 12
Object oriented programming (OOP) language
Even though C was widely accepted as a well structured programming language for a variety of applications, it had certain limitations making it unsuitable for complex programming projects.
For example, code reusability, maintainability and testability are still lacking in C programming.
This is more so as the modern software life cycle has been changing very dramatically since the late 1990s wherein the code reusability, reliability and maintainability are the key features.
The aim of using an object oriented programming language is to handle complex software design projects in a very easy, simple and efficient manner. Redesigning and maintaining the source code costs much more than reusability of the source code. The turn over time and software cost are drastically brought down due to the use of OOP language. Some of the famous objects oriented programming languages are:
Object Pascal
C++
Smalltalk
Simula
Eiffel
Java
Ada
The C++ language was designed by Bjarne Stroustrup of AT&T Bell laboratories in the early
1980s as an extension of the C language. C++ goes further than Ada and Modula-2 in supporting object oriented programming, while retaining the high level of compactness and speed offered by the C programming language. It is speculated that C++ may replace C in the future, particularly for larger programming projects and for large software systems. C++ has become quite popular due to the following reasons:
It supports all features of both structured programming and object oriented programming.
It gives the easiest way to handle data hiding and encapsulation with the help of powerful keywords such as class, private, public and protected.
Inheritance, one of the most powerful design concepts is supported with single inheritance and multiple inheritance of base class and derived classes.
Polymorphism through virtual functions, virtual base classes and virtual destructors give the late binding of the compiler.
It provides overloading of operators and functions. It also focuses on function and class templates for handling parameterized data types.
Exception handling is done by the extra keywords, namely, try, catch and throw.
Provides friends, static methods, constructors and destructors for the class objects.
Page 8 of 12
Visual Programming Languages
Visual programming is one of the key points for developing any software product with multimedia and graphical user interface. Visual effects are one of the most salient features and characteristics of the modern software especially on microcomputer systems. Icons, graphics, animated pictures and texts form the foundation for designing a visual system. Modern computer is not just an electronic information processing machine but it is a powerful tool for information gathering, collection, storing and retrieving the items in any form such as text, picture, audio and video.
Visual programming systems are computer systems which support both visual programming and visualization. Visual programming means the use of visual expressions (such as icons, drawings or gestures) in the process of programming and visualization and hence the use of visual representation (such as graphics, images or animation sequences) to illustrate programs, data, the structure of a complex system or the dynamic behaviour of a complex system.
Therefore, a visual programming language is a visual language. On the other hand, a language supporting visualization is also visual language, although such a language may not be a visual programming language. A practical application of the visual language complier is the customized design of visual user interfaces. The theory of visual languages is still in its early stages of development. Further research efforts will not only lead to interesting theoretical results, but also generate more insights into the nature of visual language as a means for human, machine and communications.
In visual information processing languages, the object to be dealt with usually have an inherent visual representation. They are images or pictorial objects which are then associated with certain logical interpretation. On the other hand, the languages themselves may not have a visual representation. Application domains of visual languages include the following:
Image processing and image communication
Computer vision
Robotics
Image data base management
Office automation
Computer graphics
Database interface
Form management
Computer aided design
In visual programming languages, objects have logical meaning but not visual image. Objects are then assigned a visual representation so that it can be visualized. Some examples of visual programming languages are:
Page 9 of 12
Visual Basic
Visual C++
Visual Foxpro
Visual J++/Java
• programming teaches you how to solve problems
• programming helps you be more precise (doesn’t win you many friends though!)
• programming gets you more out of your computer
• you may not be programming, but knowing a little bit about Programming will help you work with people who do.
Programming Languages
A programming language is a set of rules that provides a way of telling a computer what operations to perform.
Levels of Programming Languages
•
Machine language
•
Assembly Language
• High Level Languages
• Fourth Generation Languages (4GL)
•
Fifth Generation Languages (5GL)
Types of high level Programming Languages
•
Procedure-oriented languages
• Object-oriented languages
• Event-driven languages
•
Declarative languages
Page 10 of 12
Procedure-Oriented Languages
•
FORTRAN
•
COBOL
•
Pascal
• C
•
Ada
Object-oriented languages
•
Smalltalk
•
C++
• Ada 95
•
Java
•
C#
Event-driven languages
•
Visual Basic
• most Visual languages
Declarative languages (5GL)
•
Functional(?): Lisp, Scheme, SML
–
Also called applicative
–
Everything is a function
•
Logic: Prolog
–
Based on mathematical logic
–
Rule- or Constraint-based
What determines a “good” language?
•
Formerly: Run-time performance
– (Computers were more expensive than programmers)
• Now: Life cycle (human) cost is more important
–
Ease of designing, coding
Page 11 of 12
–
Debugging
–
Maintenance
–
Reusability
So really, why learn about programming?
•
Programmers make lots of money.
•
Programming really is fun.
•
Programming is very intellectually rewarding.
•
Programming makes you feel superior to other people.
• Programming gives you complete control over an innocent, vulnerable machine, which will do your evil bidding with a loyalty not even your pet dog can rival.
Page 12 of 12