3.0 C++ Programming Style
Programming styles mostly supported by language features. There are two main programming style for C++. C++ languages features support Imperative programming, or also known as Procedural programming, and Object-oriented programming languages. It is designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights.
Imperative programming, also known as procedural programming, is the program built from one or more procedures. This programming more in processing and it is suitable for the design of data structure. It uses a list of instructions to tell the computer what to do step-by-step. C++ use procedure method to code out the program. This kind of procedure method also known as routines or subroutines. A series of computation steps is carried out in the procedural programming. Imperative programming languages are also known as top-down languages. A programmer could often tell by looking at the names, arguments and return types of procedures. A complete program is still imperative since it ‘fixes’ the statement that need to be executed and their execution order to a large extent.( Zandbergen, P. (2013). Object Oriented Programming vs. Procedural Programming.).
Object-oriented programming is a programming language that uses classes and objects to create model based on the real world environment.( Eliason, K. (2013, August 1). Difference Between OOP and Procedural Programming Language.) The application of object-oriented programming may use a collection of objects which will pass messages when called upon to request a specific service of information. The objects can pass and receive message, process information in the form of data. In C++, comparing with imperative programming, using object-oriented programming is more benefit compare with imperative programming. First of all, it is ease in software design. User can think in the problem space rather than the machine’s bit and bytes. Beside that, C++ object-oriented programming is ease in software maintenance. This is because by using object-oriented software, it is easier to understand, and therefore it is easier to test, debug and maintain. In C++, it will become a very long code if using procedural programming. However, in object-oriented programming, the same function does not need to re-write for different situation. It is the fastest and safest way to develop a new application because all it have to do is reuse the existing code which is fully test and proven code. (Chua, C. (2013). Object-Oriented Programming (OOP) in C.).
Example of C++ coding:
#include <iostream>
using namespace std;
int main(){
cout << “Hello World”<<endl;
}
Programming styles mostly supported by language features. There are two main programming style for C++. C++ languages features support Imperative programming, or also known as Procedural programming, and Object-oriented programming languages. It is designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights.
Imperative programming, also known as procedural programming, is the program built from one or more procedures. This programming more in processing and it is suitable for the design of data structure. It uses a list of instructions to tell the computer what to do step-by-step. C++ use procedure method to code out the program. This kind of procedure method also known as routines or subroutines. A series of computation steps is carried out in the procedural programming. Imperative programming languages are also known as top-down languages. A programmer could often tell by looking at the names, arguments and return types of procedures. A complete program is still imperative since it ‘fixes’ the statement that need to be executed and their execution order to a large extent.( Zandbergen, P. (2013). Object Oriented Programming vs. Procedural Programming.).
Object-oriented programming is a programming language that uses classes and objects to create model based on the real world environment.( Eliason, K. (2013, August 1). Difference Between OOP and Procedural Programming Language.) The application of object-oriented programming may use a collection of objects which will pass messages when called upon to request a specific service of information. The objects can pass and receive message, process information in the form of data. In C++, comparing with imperative programming, using object-oriented programming is more benefit compare with imperative programming. First of all, it is ease in software design. User can think in the problem space rather than the machine’s bit and bytes. Beside that, C++ object-oriented programming is ease in software maintenance. This is because by using object-oriented software, it is easier to understand, and therefore it is easier to test, debug and maintain. In C++, it will become a very long code if using procedural programming. However, in object-oriented programming, the same function does not need to re-write for different situation. It is the fastest and safest way to develop a new application because all it have to do is reuse the existing code which is fully test and proven code. (Chua, C. (2013). Object-Oriented Programming (OOP) in C.).
Example of C++ coding:
#include <iostream>
using namespace std;
int main(){
cout << “Hello World”<<endl;
}