2.4 Programming Languages and Software
2.4.1 Overview of Programming Languages
Sri Lankans mainly use three languages Sinhala, Tamil and English. The purpose of a
language is to allow people to communicate.
If the computer can communicate in English it would be ideal. But the computers are not
intelligent enough to understand the human language. The computers can only
understand binary language, ie. instructions given in 0s & 1s. As a result of this computer
scientists have developed computer programming languages.
Example: Java, VB, C++, PASCAL
The function of a programming language is to provide instructions to the computer
system so that it can perform a processing activity. System software and application
software are written using these programming languages.
Each programming language has a set of keywords, symbols and a set of rules. The
symbols have a meaning known as semantics.
The set of rules, called the syntax of the language dictates how the symbols should be
combined into statements capable of conveying meaningful instructions to the computer.
In a programming language, a sentence (an instruction) is written using keywords
according to a defined syntax.
There are many different programming languages, each with its own unique symbols,
keywords and set of rules. Each programming language contains different
characteristics or attributes. Here we identify the extremes of these characteristics.
However, many of the programming languages are in between these two extremes.
When selecting a suitable programming language, it is important to consider these
characteristics (discussed in section 2.4.3).
2.4.2 The Evolution of Programming Languages
People are interested to make use of computers to perform various activities. .The
requirements of computer users have changed over the years and as a result of this, the
desire to gradually make more user friendly languages as well as languages with
particular capabilities has arisen. Hence, programming languages are also evolving to
facilitate these capabilities and needs required by computer users.
Furthermore, user community too has changed from engineers operating computers to
professional programmers and then to business users.
This evolution of the programming languages could be categorized into five
generations. The following sub-sections discuss these five generations.
First Generation Computer Languages (1940s)
First generation languages (also known as machine language/code) are the most basic
level of programming languages. In the early stages of computer development, all
program instructions had to be written in binary notation, which uses 0s & 1s.
Machine language is dependent on the type of the CPU of the computer.
For example, machine code developed for Intel 80x86 processors is different from
machine code developed for CPUs like the power PC used in Apple computers as their
internal design is very different to Intel 80x86 processors.
The use of machine language requires the writing of long strings of binary numbers even
to accomplish a simple task. Therefore, writing programs in machine language is tedious
and error prone.
Although there are more user friendly computer programming languages available today,
when the first electronic computers were developed during the 1940s, the only type of
computer language that was available was machine code.
Highly skilled technical personnel such as computer engineers/scientist were used for
the programming task. Very few people were capable of performing this programming
task due to language and operational complexity.
Second Generation Computer Languages (1950s)
As mentioned in the previous section, using machine code for programming was very
difficult and error prone. Therefore, Second Generation Languages were introduced in
the early 1950s to overcome some of these difficulties.
Assembler languages are often called symbolic languages because symbols are used to
represent operation codes and storage locations.
Alphabetic abbreviations called mnemonics (memory aids) and other symbols represent
operation codes, storage locations and data elements. Examples of mnemonics are ‘A’
for add and ‘M’ for move.
These instructions are then converted into machine code using a program called an
Assembler.
Therefore, second generation language is also known as Assembly language.
In Assembly every instruction corresponds to a machine code instruction. Since
Assembly languages corresponded to machine code, each different type of CPU has its
own type of assembly. Assembly programs are more efficient in speed and requires the
least amount of memory compared to programs developed using high level (third
generation and beyond) languages. Both machine code & Assembly are called low level
programming languages.
In general, low level programming languages are complex than high level programming
languages, and therefore require specialized personnel to write programs using these
languages.
Third Generation Computer Languages (1960s)
The shortcomings of Assembly language led to the development of the first higher level
language in the late 1950s. High Level languages are relatively easy for people to learn
as it is much closer to English than lower level languages. Due to this, many find it easier
to programme computers using 3GLs than lower level languages.
The following are some examples of four programs written in different high level
programming languages which displays the message “Hello World” on the computer
screen.
The computer cannot understand instructions given in a high level programming
language. A translator is needed to convert the high level language program into
machine code. Imagine that you got an opportunity to go to Japan as part of a student
exchange program. As a student ambassador you need to make a speech to Japanese
students about Sri Lanka. How would you carry out your speech?
It you knew how to speak Japanese, that would be the best way to carryout your speech.
But if you knew English, couldn’t you still make the speech? Yes, you could by getting
help of a translator who is conversant in both Japanese & English.
This is exactly how things work in a computer. A translator is used to translate
instructions given in a high level language into machine code.
Coming back to the earlier example you could use two approaches to conduct your
speech. One way to carry out your speech is for you to speak a few sentences in English
& pause allowing the translator to repeat what you have said in Japanese. The second
approach is that you could prepare your speech before hand & give a written copy of it to
the translator. You could conduct your speech completely in English. Your Japanese
friends would not understand anything you say, but would probably wait till you finish.
After you finish the speech the translator could repeat your entire speech in Japanese.
These two approaches are used by computers to translate high level language programs
to machine code. Translator software which uses the first approach is called interpreters
& the latter is known as compilers.
An Interpreter converts a program written in a high level language to machine code as
follows.
1. Interpret the next high level language instruction to machine code
2. Execute translated machine code instruction
3. Go to 1st step
A compiler on the other hand translates (compiles) the entire high level language
program into machine code. The converted machine code program is usually stored in
disk. In Microsoft Windows such machine code files generally have the extensions .EXE.
You can get the computer to execute these instructions by running the executable file,
i.e. by typing the name of the executable file in the command prompt or by selecting the
executable using the Windows Task Bar Run command. Compilers have major
advantages when repetitive use and speed are important, but the use of interpreters
makes it easier to debug programs and is fast enough in many situations. The same
higher level language needs different compilers or interpreters for different types of
computers. This is an important issue related to the portability of programs between
different types of computers. Although many 3GL languages were written with machine
independence in mind, compilers for the same language on different machines often
have some inconsistencies.
There are hundreds of different high level programming languages available with newer
ones being developed regularly. One of the reasons for this is because different
developers have made different attempts to make programming (writing computer
programs) much easier.
Some of the high level computer languages are general purpose languages. This means
that these languages could be used to write programs which solve a wide range of
problems. These could include business applications, games, web applications etc.
Java, C++, Visual Basic are examples of such languages.
There are some high level languages which are used for special purposes. These
languages are intended for writing specific types of programs only. For example COBOL
is the traditional language used for developing business applications. FORTRAN is
used to developing scientific, engineering types of applications.
Third generation languages are basically tools for professional programmers. High level
of programming skills are needed to use these languages for business applications.
Using these languages can be difficult and time consuming even for professional
programmers.
Fourth Generation Computer Languages (1970s)
The drawbacks of 3GLs have encouraged the development of new ways to make
programmers more productive and permit non programmers to do programming work.
Fourth Generation Languages (4GLs) are a loosely defined group of programming
languages that make programming less procedural than 3GLs.
4GLs targeted non-programmers and hence the need to perform a task by specifying
what is required arose. Non-procedural languages catered for this request by hiding the
processing details from the user/programmer.
For every narrow domain (specific areas) fourth generation programming languages
have been developed, where you only needed to describe what is required. The most
famous example of a fourth generation language is the Structured Query Language
(SQL) which is used with databases.
Using SQL you can retrieve data from a database in different formats for various
conditions just by specifying the headings you need, where they are stored (in tables)
and the conditions.
Fig. 2 compares the differences when instructing a computer using SQL & C to retrieve
data from a database. The example prints a list of students who have obtained an
average of above 75 from a database. In the C example you are required to write all the
details on how the data should be retrieved. In the SQL example only the requirements
needs to be specified.
The benefits of 4GLs extend to both programmers and end users. Programmers need
less time and effort to specify the required processing. Writing the same reporting
program in COBOL may take longer because of all the details that must be incorporated
into COBOL programs.
End users benefit because 4GLs provide a way to obtain information without requiring
the direct help of a programmer.
Although several benefits exist there are some drawbacks of 4GL languages. The
machine language code generated by a program developed by a 4GL is frequently much
less efficient (in terms of processing speed and amount of storage capacity needed) than
a program written using a language like COBOL.
Some transaction applications written using 4GLs have not provided reasonable
response times when dealing with a large amount of real-time transaction processing
and end user queries. However, the use of 4GLs have shown to be successful in
business applications that do not have a high volume of transaction processing.
All 3GL are procedural oriented. This means that programmers have to specify how to
solve the task using step by step instructions.
Beyond Fourth Generation Computer Languages
Beyond 4th generation of programming languages, classifying them becomes a difficult
task. Programming languages used to create artificial intelligence or expert system
applications are often called fifth generation languages. These programming languages
are easy for nonprogrammers to use. They are sometimes called natural languages as
they use even more English like syntax than 4GLs.
e.g. LISP, Prolog, MYCIN
Few people showed interest in natural languages due to its specialized nature and
applicability in the real world. Computers programmed in 5GLs can understand queries
such as, “what is the quantity of product X sold last month?”
Visual and object-oriented programming languages have also emerged to assist
programmers. These programming languages have had more user acceptance than the
natural languages.
Visual languages use graphical or visual interfaces for programming. Instead of writing
code the programmer could “drag and drop” programming objects on the computer
screen and create programs. Visual programming language tools would automatically
generate the high level code for the selected programming objects. This reduces the
need to write detailed programming statements required by earlier programming
languages.
Object-Oriented Programming (OOP) languages have become major tools of software
development. While most other languages separate data elements from the procedures
or actions that will be performed upon them, OOP languages tie them together into
objects. This means that an object consists of data and the actions that can be
performed on the data. For example, an object could be data about products in an
inventory and the action that can be performed on this data such as calculation of sales
revenue generated by this product. An object also could be a set of data in graphic form
such as a video display window, plus the display actions that might be based up on it.
In procedural languages, a program consists of procedures to perform actions on each
data element. However, in object-oriented systems, objects tell other objects to perform
actions on themselves. This is because the object also contain what action should be
taken.
Object-oriented languages are easier to use and more efficient for programming
graphics-oriented user interfaces required by many applications. Therefore, they are
most widely used programming languages for software development. Furthermore,
another advantage is the reusability of the objects.
e.g. Visual Languages - Visual Basic, Visual C++
OOP Languages – Smalltalk, Visual Basic.Net, C++, Java
2.4.3 Selecting a Programming Language
Selecting the best programming language to solve a particular problem involves
balancing the functional characteristics of programming languages.
Batch vs. Real-time Programming Languages (PLs)
An example of a batch process would be the process of collecting letters and distributing.
In this process the post-office would collect letters from all sub-post officers and letter
boxes from its vicinity. All collections during the day is sorted and dispatched once a day
to appropriate cities or households.
However if a customer requests a post-office to send a telegram or email they have to
dispatch the message immediately without a delay. Hence processing the dispatch of a
telegram/email is a real-time processing.
Similarly, in a bank, cheque deposits are collected over the morning business hours and
processed as a batch in the afternoon while a cash withdrawal is done then and there as
a real-time processing.
In the early days computer processing capabilities were limited and computers were
incapable of handling requests in real-time. Thus batch process was the way of using
computers. However with time hardware became cheaper and powerful and was easily
able to perform many tasks on real-time. Thus a bank is now able to view the current
account balance of a customer and cheques to be realized from any of its branches.
Real-time processing languages must have the capability to perform processing quickly
through direct access and manipulation of data files or databases.
Procedure vs. Non-procedure orientation
All third generation languages are procedural oriented although some of them are more
structured (e.g. Pascal) than others (C). Programmers have to specify how to solve the
task using step by step instructions.
Fourth generation languages targeted non-programmers and hence the need to perform
a task by specifying what is required arose. Non-procedural languages catered for this
request by hiding the processing details from the user/programmer.
PLs for Business vs. Scientific applications
Computers were used by organizations to automate their business processors. Most
business processors manipulate quantities of large data in the form of text and numbers
to present information through extraction or summarization of data.
Some programming languages support business applications which require such
manipulation of data whereas some programming languages support sophisticated
scientific computations.
Low productivity vs. High productivity
Depending on the type of programming language used, the productivity may increase or
decrease. Some programming languages allow to create a large amount of code per unit
of time, whereas some other languages may be less productive and able to create only a
small amount of code per unit of time.
High error level vs. Low error level
When new programming languages emerged one of the goals have been to minimize
defects and increase reusability. Reducing source code, make code more readable have
made programs easier to understand and debug. Early coding was more likely to contain
defects due to its lengthy procedural style coding. Modern non-procedural and objectoriented
coding has significantly reduced the source code thus minimizing the error level.
Software maintenance is becoming easier as a result and reusing software routines is
also commonly practiced.
Apart from the characteristics mentioned above, let’s consider other factors that should
be considered. . In selecting a programming language, the amount of direct control for
the operation of the hardware can be an important factor to consider.
Machine & assembly languages provide the most direct control over computer hardware.
Therefore, many of the popular application software vendors take the time and effort to
code portions of their leading programs in assembly language to maximize their speed.
When a programmer requires a high degree of control to manipulate various hardware
components, these languages should be used.
Although the newer languages appear to be simpler because they are more English-like,
each command can drive complex routines and functions that operate behind the
scenes. Due to the user friendliness of higher level languages, it takes less time to
develop computer programs using higher level languages than using lower level
languages. This means that the cost to develop computer programs can be substantially
less with these more recent programming languages. Although training programmers to
use these higher-level programming languages may produce high up-front costs, using
higher-level languages can reduce the total costs to develop computer programs in the
long run.
Furthermore, it is useful to match your requirements with attributes/characteristics of
programming languages. For example if you require batch processing it is important to
select a programming language that will support this requirement. Although most of the
programming languages are nowadays are general purpose allowing programmers to
solve most of the problems.
Over the period of time programming languages have emerged targeting special needs.
E.g. COBOL as a special purpose language for business, FORTRAN as a special
purpose language for scientist, SQL as a special purpose language for database users
and CLI or C as a special purpose language for system programming.
Infolinks In Text Ads
EasyHits4U.com - Your Free Traffic Exchange - 1:1 Exchange Ratio, 5-Tier Referral Program. FREE Advertising!
Blog Archive
-
▼
10
(45)
-
▼
May
(38)
- 4.4 Communication Networks and the Business Value4...
- 4.3 Role of networks in organizationsNetworks are ...
- 4.2 The Competitive Advantage and Strategic Inform...
- 4.1 OrganizationsAn organization is a formal colle...
- 4 Organizations and Information SystemsUntil the e...
- 3.4. Database ApplicationsIntroduction to Database...
- 3.3. Database Management SystemsIntroductionCreati...
- 3.2. Data Modeling & the Relational Database Model...
- Lesson 3: Organizing Data and Information3.1. Data...
- 2.5 Software Issues & TrendsSoftware is an increas...
- 2.4 Programming Languages and Software2.4.1 Overvi...
- 2.3. SoftwareSystems software is the set of progra...
- 2.2. Types of Computer SystemsToday computer syste...
- 2.1.6 Output DevicesOutput from a computer system ...
- 2.1.5 Input DevicesInput devices allow users to en...
- 2.1.4 Secondary StorageOrganizations need to store...
- 2.1.3 Main MemoryMain memory is located close to t...
- 2.1.2 The Central Processing Unit (CPU)The CPU con...
- Lesson 2: Information Technology Concepts2.1.1 Ove...
- 5.2 Information Systems CareersInformation systems...
- 5.1 Computer and Information Systems LiteracyIn th...
- 5 Importance of Learning Information SystemsInform...
- 4.2 Managerial Challenges of ITAs discussed in the...
- 4 The Role of IS in Business and Managerial Challe...
- 3.5 Trends in Business Information SystemsUntil th...
- 3.4 Activities of an Information SystemBasic infor...
- 3.3 Computer based Information Systems3.3.1 A comp...
- 3.2 Main Components of an Information SystemIn thi...
- 3 Information Systems3.1 What is an Information Sy...
- 2.5 Modeling a SystemMany things in the real world...
- 2.4 System variables and ParametersSome parts of a...
- 2.3 System performance and standardsWhether a syst...
- 2.2 System components and conceptsIn abstract term...
- 2 System and modeling concepts2.1 What is a system...
- 1.3 The Value of Information1.3.1 Value of informa...
- 1.2 The characteristics of Valuable InformationThe...
- 1.1 Information ConceptsIn this sub-section, we wi...
- SEMESTER 1
-
▼
May
(38)
0 comments:
Post a Comment