Basic Programming Terms And Definitions
As we all know the value of basics during an interview. If you choose any domain in your life or acquire any new skills, basic terms always play an important role. This will help you to know the domain better and faster.
Before learning any programming language, there are some basic terms that everyone should know. So we have listed some commonly used programming terms that a programmer should know before starting coding. The learning objective of this article is to let a programmer know about basic programming terms.
Common Programming Terms
Comments are used to describe the logic used in a program. Commented lines will be ignored by the compiler during compilation of source code to machine code. So these comment lines will not be displayed in the output screen. Comments are basically used for better understanding of code.
Generally we have 2 types of comment lines:
1.Single line comments : If any statement starts with “//” then that line is commented.
2.Multiple line comments : If any block of code or statements enclosed within /*any no. of lines*/.
Keywords are predefined words or reserved words in library with a fixed meaning and used to perform an internal operations.
For example : auto, double, int, break, else etc.
Constant is an identifier whose values cannot be changed at the execution time of a program, unlike a variable. Number, Character and String can be refer as constant. Constant can not be altered and will remain fixed throughout the execution of code.
const int a = 10;
a = 20; // Invalid
Variable is an identifier which holds data. Value of variable can be changed depending on the code. Variable name should start with alphabets or underscore (_) and no spaces are allowed in variable name. Except underscore (_) no special symbol are allowed. Variable name always should exist in the left side of assignment operator. keyword can not be used as variable name.
Common Syntax - data_type variable_name = value;
int a = 20;
5. Garbage Value
When we are declaring a variable without assigning any value to it, then the value available to that memory location will be consider as garbage value.
Those values are no way related to the program and are called as garbage value.
It can be overcome by using variable initialization.
It is a keyword used to identify type of data. It is used for storing the input of the program into the main memory (RAM) of the computer by allocating sufficient amount of memory space in the main memory of the computer.
In general every programming language is containing three categories of data types. They are : Fundamental or primitive data types, Derived data types, User defined data types.
7. Pre-processor directive
Pre-processor directive can be used to include all the predefined method of given header files or libraries into current program before compilation.
An array is a collection of data that holds fixed number of values of same data type. You can access elements of an array by using indices. In general first index of array is 0.
Pointer is a variable whose value is the address of another variable. Address of any variable can be accessed using reference(&) operator. To get the value stored in the memory address, we use the dereference operator (*).
Function refers to a segment that groups code to perform a specific task. Depending on whether a function is predefined or created by programmer. There are two types of functions :
1. Library Function : Library functions are the built-in functions i.e functions provided by programming language by default.
2. User-defined Function : A user-defined function groups code to perform a specific task and that group of code is given a name. These are not pre defined functions they are created by programmers.
In Object-Oriented programming, Class is a template which contains data and functions together. It is a blue print for a data type.
For example : There might be a class called Box which contains data member which are length, breadth, height.
In Object-Oriented programming, Instance of class is called as object. Member data and member functions are accessed by objects. One class can have any number of objects.
For example : There might be a class called Car which contains objects which are BMW, AUDI.
Error occurred during run time is known as exception. Exceptions hinder the normal execution of program. Exception handling is the process of handling errors and exceptions in such a way that they do not hinder normal execution of the system. An example of an exception can be the case when you divide a number by 0, then exception occur.
An algorithm can be defined as a set of rules or instructions designed to solve a given problem. An algorithm is a process performed before the actual implementation.
API stands for Application Programming Interface, it defines interactions between multiple software intermediaries or it is set of programming code that enables data transmission between one software product and another. For example google and amazon use APIs to help programmers gain easier access to their services.
A computer program is defined as a collection of instructions that are organized in a way that performs a specific task or function. Before a program is executed, it is processed by the computer CPU. An example of a program is Microsoft Excel, which is a spreadsheet application that enables users to do calculation.
Arguments are used to pass a value to a function or command-line. The argument value can be in the form of an integer, float, string, character, boolean, array.
ASCII stands for American Standard Code for Information Interexchange which is used to assigns letters, numbers and special characters to different slots, available in the 8-bit code. The total number of slots available is 256. For example, the ‘A’ sign is assigned ASCII decimal number 065, while the lowercase ‘a’ character is assigned 097.
A coding error in a computer program is known as a bug, which is a flaw in the hardware or software that causes it to malfunction. The solution to the bug is to do testing.
The CLI is command-line interface, it is a text-based UI (user interface) that is used to view and manage computer files. CLI are also known as command-line user interfaces, console user interfaces and character user interfaces.