Java Reference
In-Depth Information
In a written language, you may form a grammatically correct sentence, which may not have any valid meaning.
For example, “The stone is laughing.” is a grammatically correct sentence. However, it does not make any sense. In a
written language, this kind of ambiguity is allowed. A programming language is meant to communicate instructions
to computers, which have no room for any ambiguity. We cannot communicate with computers using ambiguous
instructions. There is another component of a programming language, which is called semantics. The semantics of
a programming language explain the meaning of the syntactically valid programming constructs. The semantics of a
programming language answer the question, “What does this program do when it is run on a computer?” Note that a
syntactically valid programming construct may not also be semantically valid. A program must be syntactically and
semantically correct before it can be executed by a computer.
The pragmatics of a programming language describe its uses and its effects on the users. A program written in
a programming language may be syntactically and semantically correct. However, it may not be easily understood
by other programmers. This aspect is related to the pragmatics of the programming language. The pragmatics are
concerned with the practical aspect of a programming language. It answers questions about a programming language
like its ease of implementation, suitability for a particular application, efficiency, portability, support for programming
methodologies, etc.
Programming Paradigms
The online Merriam-Webster's Learner's dictionary defines the word “paradigm” as follows:
“A paradigm is a theory or a group of ideas about how something should be done, made,
or thought about.”
In the beginning, it is a little hard to understand the word “paradigm” in a programming context. Programming
is about providing a solution to a real-world problem using computational models supported by the programming
language. The solution is called a program. Before we provide a solution to a problem in the form of a program,
we always have a mental view of the problem and its solution. Before I discuss how to solve a real-world problem
using a computational model, let's take an example of a real-world social problem, one that has nothing to do with
computers.
Suppose there is a place on Earth that has a shortage of food. People in that place do not have enough food to eat.
The problem is “shortage of food.” Let's ask three people to provide a solution to this problem. The three people are a
politician, a philanthropist, and a monk. A politician will have a political view about the problem and its solution. He
may think about it as an opportunity to serve his countrymen by enacting some laws to provide food to the hungry
people. A philanthropist will offer some money/food to help those hungry people because he feels compassion for
all humans and so for those hungry people. A monk will try to solve this problem using his spiritual views. He may
preach to them to work and make livings for themselves; he may appeal to rich people to donate food to the hungry;
or he may teach them yoga to conquer their hunger! Did you see how three people have different views about the
same reality, which is “shortage of food"? The ways they look at the reality are their paradigms. You can think of a
paradigm as a mindset with which a reality is viewed in a particular context. It is usual to have multiple paradigms,
which let one view the same reality differently. For example, a person who is a philanthropist and politician will have
his ability to view the “shortage of food” problem and its solution differently, once with his political mindset and once
with his philanthropist mindset. Three people were given the same problem. All of them provided a solution to the
problem. However, their perceptions about the problem and its solution were not the same. We can define the term
paradigm as a set of concepts and ideas that constitutes a way of viewing a reality.
Why do we need to bother about a paradigm anyway? Does it matter if a person used his political,
philanthropical, or spiritual paradigm to arrive at the solution? Eventually we get a solution to our problem. Don't we?
 
Search WWH ::




Custom Search