A programming language is a set of rules that provides a way of telling a computer what operations to perform or it can be defined as is a notational system for describing computation in a machine-readable and human-readable form.
Programming Techniques is defined as way or manner in which problem is approached & Code is written. Basically, Programming Techniques can be categorized as follows:
Usually, people start learning to program by writing small and simple programs consisting only of one main program. Here `` main program'' stands for a sequence of commands or statements which modify data which is global throughout the whole program. We can illustrate this as shown in figure below:
Pascal, FORTRAN, C, and similar languages are procedural languages. A program in a procedural language is a list of instructions. Each instruction tells the computer to do something. To write a program, a programmer creates a list of instructions, and the computer carries them out. No other organizing principle or paradigm is needed for writing programs. Later, the concepts of functions and modules were introduced as a part of structured programming to make large programs more comprehensible.
The main program is responsible for passing data to the individual calls, the data is processed by the procedures and, once the program has finished, the resulting data is presented. The main program coordinates call to procedures and hands over appropriate data as parameters.Thus, the flow of data can be illustrated as a hierarchical graph, a tree, as shown in Figure below for a program with no sub procedures.
Modular programming (sometimes known as structured programming) is a subset of procedural programming that enforces a top-down design model, in which developers map out the overall program structure into separate subsections to make programs more efficient and easier to understand and modify. A defined function or set of similar functions is coded in a separate module or sub-module, which means that code can be loaded into memory more efficiently and that modules can be reused in other programs. In this technique, program flow follows a simple hierarchical model that employs three types of control flows: sequential, selection, and iteration.(C++ Programming with Object-Oriented Approach
Modular programmingAlmost any language can use structured programming techniques to avoid common pitfalls of unstructured languages. Most modern procedural languages include features that encourage structured programming. Object-oriented programming (OOP) can be thought of as a type of structured programming, uses structured programming techniques for program flow, and adds more structure for data to the model. Some of the better known structured programming languages are Pascal, C, PL/I, and Ada.
Objects are the entities in an object-oriented system through which we perceive the world around us. We naturally see our environment as being composed of things which have recognizable identities & behavior.
Methods are common operation that object can perform. In earlier paradigms, it was popularly known as Function or Procedure.
When describing objects, it is common to make reference to attributes. Attributes describe an object. Attributes are sometimes called fields or instance variables.
The term 'state' describes the value of an attribute/instance variable at any given time. The following example shows different attributes for an object, in this case, a train. At any point in time, the attributes will have a state. The state of an attribute is simply its current value.