0% found this document useful (0 votes)
2 views

Selection and features of a programming language

The document outlines essential characteristics of a good programming language, including simplicity, naturalness, abstraction, efficiency, structured programming support, compactness, locality, extensibility, and suitability to its environment. It also discusses good programming practices such as clarity, proper naming of identifiers, comments, and indentation, as well as characteristics of good programming like flexibility, user-friendliness, portability, reliability, and self-documenting code. Additionally, it provides criteria for selecting a programming language based on application nature, familiarity, ease of learning, development tools, execution efficiency, and language features.

Uploaded by

roynancy2k6
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Selection and features of a programming language

The document outlines essential characteristics of a good programming language, including simplicity, naturalness, abstraction, efficiency, structured programming support, compactness, locality, extensibility, and suitability to its environment. It also discusses good programming practices such as clarity, proper naming of identifiers, comments, and indentation, as well as characteristics of good programming like flexibility, user-friendliness, portability, reliability, and self-documenting code. Additionally, it provides criteria for selecting a programming language based on application nature, familiarity, ease of learning, development tools, execution efficiency, and language features.

Uploaded by

roynancy2k6
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Several Characteristics believed to be essential for a good programming language are:-

1. Simplicity: A good programming language must be simple and easy to learn and use.
It should provide a clear, simple, and agreeable set of concepts to a programmer that
they can grasp quickly.
The simplicity of a programming language also strongly affects the readability of the
programs. And also, programs that are easier to read and understand are easier to
maintain. Developing and implementing a compiler or an interpreter for a simple
programming language is also easy.
However, designers should not sacrifice the power needed for the language to achieve
simplicity.
2. Naturalness: A good language for an application area should be natural for
programming applications. It should provide appropriate operators, data structures,
control structures, and a natural syntax to facilitate programmers to code their
problems quickly and efficiently.
FORTRAN and COBOL are good examples of languages possessing a high degree of
naturalness in scientific and business application areas, respectively.
3. Abstraction: Abstraction means the ability to define and then use complicated
structures or operations in ways that allow programmers to ignore many of the details.
The degree of abstraction a programming language allows directly affects its ease of
programming.
For example, object-oriented languages support a high degree of abstraction. Hence,
writing programs in object-oriented programming (OOP) languages is much easier.
Object-oriented languages also support the reusability of program segments due to this
feature.
4. Efficiency: A program written in a suitable programming language enables a
computer system to translate it into machine code efficiently, execute it efficiently, and
manage it with less memory. A good programming language is supported by a good
language translator (a compiler or an interpreter) that considers space and time
efficiency.
5. Structured programming Support: A good programming language should have
the necessary features to allow programmers to write their programs based on
structured programming concepts. It significantly affects the ease with which a
programmer can write, test, and maintain their programs.
Moreover, it forces the programmer to look at a problem logically so that they create
fewer errors while writing a program for the problem.
6. Compactness: In a good programming language, programmers should be able to
express the intended operations concisely without losing readability. Programmers
generally dislike verbose language because they need to write too much. Many
programmers dislike COBOL because it is lengthy (lacks compactness).
7. Locality: A good programming language should be such that while writing a program,
a programmer need not jump around visually as they prepare the program’s text. It
allows the programmer to concentrate almost solely on the part of the program around
the statement they are currently working on.
COBOL and, to some extent, C and Pascal lack locality because data definitions are
separated from processing statements, perhaps by many pages of code, or have to
appear before any processing statement in the function/procedure.
8. Extensibility: A good programming language should allow extension through simple,
natural, and elegant mechanisms. Almost all languages provide subprogram definition
mechanisms for this purpose, but some are weak.
9. Suitability to its environment: In addition to being suitable for its application area, a
good programming language must also be ideal for its operating environment.
For example, a language for real-time applications must be interactive. On the other
hand, a language for data processing applications like payroll, stores accounting,
etc., may operate in batch mode.

Good programming:
A Good Program means that it should produce correct and faster results, taking into
account all the memory constraints. While making good programs, we need to follow
certain guidelines of programming language for creating a successful program. The
following is the list of good programming habits that one should keep in mind while
writing:
1) Clarity and Simplicity of Expression
2) Use of proper names for identifiers
3) Comments
4) Indentation

1) Clarity and Simplicity of Expression:


Expressions are use to implement a particular task. It is a combination of Operators,
Operands, and Constants. Any expression used in the program should be understood by
the user. Example.
1. Use library functions to make programs more powerful
Example:
To find output = x6
Output = X *X * X * X * X * X
Instead of writing the above line we can use library function and can make it
shorter.
We can use output = power (X, 6)
2. Follow simplicity to maintain the clarity of expression
Example:
X = A+B/A-B – U +VY/X+Y
We may simplify the above expression and write:
X1 = (A+B) / (A-B)
X2 = (U+V*Y) / (X +Y)
X = X1 –X2
 Avoid program tricks usage, whose meaning is difficult to understand by the user.
2) Use of proper names for identifiers :
Identifiers are user defined names. They are use to name things. A name is associated
with a function or data object (constants and variables) and used to refer to that
function or data object. Identifiers are made up of letters (A-Z, a-z), digits (0-9), and the
underscore character ( _ ). They, however, must begin with a letter or underscore and
not with a digit.
1. Give meaningful names for variables (data – object) and function.
Example:
To calculate Area of a Square:
We use the variable names are Area and Side
Area = Side * Side.
2. Use proper names for constants.
Example:
¶ = 3.14
Give Pi = 3.14
Do not use the same name like custom, customer or account, accountant.
Do not use one letter identifiers.
3) Comments :
They are usually added with the purpose of making the source code easy to understand.
Hence, add comments to your code in simple English language that describes the
function of the code and the reason for your decision to do it in a particular way as well.
They are generally categorized as either “block comment‟ or „line comment‟. Block
comment is implemented in python by “”” and “”” and line comment is implemented by
#.
Example:
“Write a program to print all numbers from 1 to 100 using while loop in python” .
A=1
while (a<100): # While statement print a
a = a+1
4) Indentation:
Leading white space (spaces and tabs) at the beginning of each statement, which is used
to determine the group of statements, is known as “indentation‟.
Example:
If A > B :
print „A is Big‟ # Block1
else:
print „B is Big‟ # Block2
If the “if‟ expression evaluates to true, then Block1 is executed, otherwise, it executes
Block2.

Characteristics of good programming :


The quality of the program depends upon the instructions given to it. However, it is
required to provide the proper and correct instructions to the computer in order to
provide a correct and desired output. Hence, a program should be developed to ensure
the proper functionality of the computer and also should be easy to understand. A
computer program should have some important characteristics, which are as follows :
1) Flexibility
2) User Friendly
3) Portability
4) Reliability
5) Self-Documenting Code
1) Flexibility:
A program should be flexible enough to handle most of the changes without having to
rewrite the entire program. For example, CAD (Computer-Aided Design) software is use
for different purposes such as; engineering drafting, printing circuit board layout, and
design, architectural design, technical drawing, industrial art, etc.
2) User Friendly:
A program that can be easily understood by a beginner is called „user friendly‟. It must
interact with the user through understandable messages. In addition, the proper
message for the user to input data and to display the result, besides making the
program easily understandable and modifiable.
3) Portability:
Portability refers to the ability of an application to run on different platforms (operating
systems) with or without minimal changes. Since the change of platform is a common
phenomenon nowadays, due to the developments in hardware and the software,
portability has to be taken care of it.
High language programs are often more portable than assembly language programs.
4) Reliability:
It is the ability of a program to do its intended function accurately even if there are even
small changes in the computer system.
Moreover, the program must be able to handle unexpected situations like wrong input
or no input.
For example, if the user does/gives wrong information to input, it should display a
proper error message.
5) Self-Documenting Code:
The source code, which uses a suitable name for the identifiers (variables and methods),
is called the self-documenting code.
Also, giving a proper name for variables and methods would tell the reader of your code
clearly -what is it doing? Hence, a good program must have a self-documenting code.

Selecting a Programming Language for Coding


Programmers often face selecting a programming language from the many options
available today in the programming world. The following factors generally impact the
selection process:
1. Nature of the application: A programmer should select a language appropriate for
the application area.
For example, FORTRAN is convenient for scientific and engineering applications,
while COBOL is suitable for business applications.
2. Familiarity with the language: If the programmer finds multiple languages suitable
for the application area, they should select the one with which they and other
programmers in their team (who will code the application) are most familiar.
3. Ease of learning the language: If the programmer finds that multiple languages are
suitable for the application area and the programmers are not familiar with any of them,
they should select the language that is easy to learn and use.
4. Availability of program development tools: Before selecting a language, the
programmer must also find out if the programming environment of the language has
good program development tools like a compiler, interpreter, debugger, linker, etc.
A language with a good set of program development tools can drastically reduce the
time and effort of the team of programmers involved in coding an application.
5. Execution efficiency: If the execution efficiency of an application is essential, the
programmers can use an assembly language instead of a high-level language for coding
the application. Because an assembly language program written by a clever programmer
usually has a shorter production run time and takes less storage space than a program
written for the same application in a high-level language.
6. Features of a suitable programming language: Finally, the features of a good
programming language discussed in the previous section often influence the selection
process.

Selection Criteria for a Programming Language


1. Usability
Easy to learn, ease of use for an experienced programmer.
2. Performance
Speed of program execution, speed of compiler execution (a program which
translates the program into machine code), stability (lack of defects).
3. Portability
A portable language is one which is implemented in variety of computers (design
relatively machine dependent). Well defined language are more portable than others
e.g. C, C++.
4. Extendibility
Possibility of developing the language and its implementation, existence function
libraries, class libraries, etc.
5. Continuity
Continuity of the manufacturer, language continuity, implementation continuity,
existence of international standards for defining the language, conformity of
implementation by following standards, existence of other manufacturers for that
language.

You might also like