Programming languages comes in all tastes and designs and at any given time new languages are being invented, but there are features that you will likely find in any given language. These are the feature which makes them be regarded as programming languages anyway.
In this article we will look at the various features of most programming languages in use today.
Compiler or interpreter
Support for arithmetic operations
Algebraic operations
Programming languages provides utilities to perform basic algebraic operations. Operations supported includes all the basic ones such as addition , subtraction ,division ,multiplication and modular arithmetic. In most languages there are reserved symbols to perform this arithmetic operations, some languages also provide builtin functions on top of the reserved symbols. The most common symbols in most programming languages for this operations are:
addition | + |
Subtraction | - |
Division | / |
multiplication | * |
modulo operation | % |
Most languages also comes with builtin libraries for advanced mathematical operations
Relational operations
In most languages there is normally a way to establish a relation between two or more items. This relation is normally based on mathematical 'less than', 'greater than' , 'equal to' etc , but some languages also allows programmers to define the method used to establish the relation.
The most common symbols used for relational operations are usually:
Equal | == |
greater | > |
smaller | < |
greater or equal | >= |
smaller or equal | <= |
Logical operations
A logical operation is an operation that acts on binary numbers according to the laws of boolean logic.The results of this operations are usually in binary form such as true or false. The three basic logical operators are 'or' , 'and' and 'not'. Programmers can as well combine these operators to perform more complicated operations. Most programming languages use symbols to denote this operations but some like python uses the full words.For example the following table shows the symbols used by C and most similar languages for logical operations:
and | && |
or | || |
not | ! |
Conditional branching
Wanting to do something only if a certain condition or conditions are satisfied is one of the most common things in programming , for example in authentication systems, a program authenticates a person on condition that the password they enter matches the one stored in the database for the user.
Almost all programming languages supports in one way or another a way of performing actions based on conditions. Most languages implements this using the trio keywords 'if', 'else if' and 'else' , this is not always the case , for example python uses elif instead of else if.
Looping
Looping is performing certain actions repeatedly until a certain action until a condition is not met. Looping forms one of the strongest features of programming languages because it gives programmers the power to perform similar actions without repeating the same lines of codes thus avoiding code redundancy.
There are mostly three types of loops in most programming languages even though their implementations might be different depending on the language, these are 'for', 'while' and 'do while' loops . This is not always the case, for example python does not support the ' do while ' loop in anyway.
Functions
A function is a group of statements which are executed together to perform a certain task. Functions are mostly used in order to perform a recurring task or which is likely to be encountered in future . Most programming language have a way of supporting the use of functions, they normally provide keywords for implementing the functions.
One of the notable and useful application of functions is in object-oriented programming, they are used to abstract various behavior or actions of an object instance.
Data types
A datatype defines various features of a data item such as the values it can take and the various operations that can be performed on it. Data types supported by most of the programming languages includes basic ones also known as scala data types for example
integral data types
- integers
- boolean
- floats
- Double
other basic data types are characters and strings
They also support advanced ones which can be customized by programmers depending on the requirements such as classes and structures.
Data structures
Data structures are the various ways that a data can be organized, manipulated , stored and retrieved in a computer. Some data structures includes arrays, stacks, lists, Queues and many others. The most fundamental data structure in computers is the array and almost all languages supports them. Arrays are contagious locations in the computer's memory, in fact the whole of computer's memory can be seen as one long array. When programming languages declares an array, the operating system sets aside a small contagious part in the memory equal to the specified size. An array can as well be used to make other data structures such as a stack and queue.
Some programming languages also comes with other inbuilt data structures .
referencing objects in computer memory
Syntax
Input/Output(I/O)
Input and output are two of the most fundamental components of a programming language. Input is the process of getting information or data into the computer system, while output is the process of getting information or data out of the computer system. Examples of input include a user typing on a keyboard, a mouse click, or a file being uploaded to a computer. Examples of output include a document being printed, a visual display, or a sound being played.
Memory Management
Memory management is the process of allocating, scheduling, and reclaiming of objects in memory. It is a critical part of any program and is necessary to ensure efficient use of system resources (CPU, RAM, etc.). Memory management is handled differently in different programming languages, with different approaches such as garbage collection, reference counting, and manual management.
Exception handling
Exception handling is a process of handling errors that occur during the execution of a program. It is a key component of programming languages and is supported by most modern languages like Java, C++, and Python.It helps in creating programs that are more reliable, efficient, and secure.
Interoperability
Languages often provide ways to interact with code written in other languages. This can include support for calling functions or using libraries written in different languages or integration with existing systems and APIs.