Advantages and Disadvantages of C++
Advantages of C++
1. Portability
C++ offers the feature of portability or platform independence which allows
the user to run the same program on different operating systems or interfaces
at ease.
C++ offers the feature of portability or platform independence which allows
the user to run the same program on different operating systems or interfaces
at ease.
2. Object-oriented
One of the biggest advantages of C++ is the feature of
object-oriented programming which includes concepts like classes, inheritance,
polymorphism, data abstraction, and encapsulation that allow code reusability
and makes a program even more reliable.
One of the biggest advantages of C++ is the feature of
object-oriented programming which includes concepts like classes, inheritance,
polymorphism, data abstraction, and encapsulation that allow code reusability
and makes a program even more reliable.
3. Multi-paradigm
C++ is a multi-paradigm
programming language. The term “Paradigm” refers to the style of programming.
It includes logic, structure, and procedure of the program.
C++ is a multi-paradigm
programming language. The term “Paradigm” refers to the style of programming.
It includes logic, structure, and procedure of the program.
4. Low-level Manipulation
Since C++ is closely associated with C, which is a
procedural language closely related to the machine language, C++ allows
low-level manipulation of data at a certain level. Embedded systems and
compiler are created with the help of C++.
Since C++ is closely associated with C, which is a
procedural language closely related to the machine language, C++ allows
low-level manipulation of data at a certain level. Embedded systems and
compiler are created with the help of C++.
5. Memory Management
C++ gives the programmer the provision of total
control over memory management. This can be considered both as an asset and a
liability as this increases the responsibility of the user to manage memory
rather than it being managed by the Garbage collector. This concept is
implemented with the help of DMA (Dynamic memory allocation) using pointers.
C++ gives the programmer the provision of total
control over memory management. This can be considered both as an asset and a
liability as this increases the responsibility of the user to manage memory
rather than it being managed by the Garbage collector. This concept is
implemented with the help of DMA (Dynamic memory allocation) using pointers.
6. Large Community Support
C++ has a large community that supports it by
providing online courses and lectures, both paid and unpaid.
C++ has a large community that supports it by
providing online courses and lectures, both paid and unpaid.
7. Compatibility with C
C++ is pretty much compatible with C. Virtually, every
error-free C program is a valid C++ program. Depending on the compiler used,
every program of C++ can run on a file with .cpp extension.
C++ is pretty much compatible with C. Virtually, every
error-free C program is a valid C++ program. Depending on the compiler used,
every program of C++ can run on a file with .cpp extension.
8. Scalability
Scalability refers to
the ability of a program to scale. It means that the C++ program is capable of running on a small scale as well as a large
scale of data. We can also build applications that are resource intensive.
Scalability refers to
the ability of a program to scale. It means that the C++ program is capable of running on a small scale as well as a large
scale of data. We can also build applications that are resource intensive.
Disadvantages of C++
1. Use of Pointers
Pointers in C/C++ are a relatively difficult concept to grasp and
it consumes a lot of memory. Misuse of pointers like wild pointers may cause
the system to crash or behave anomalously.
Pointers in C/C++ are a relatively difficult concept to grasp and
it consumes a lot of memory. Misuse of pointers like wild pointers may cause
the system to crash or behave anomalously.
2. Security Issue
Although object-oriented programming offers a lot of
security to the data being handled as compared to other programming languages
that are not object-oriented, like C, certain security issues still exist due
to the availability of friend functions, global variables and, pointers.
Although object-oriented programming offers a lot of
security to the data being handled as compared to other programming languages
that are not object-oriented, like C, certain security issues still exist due
to the availability of friend functions, global variables and, pointers.
3. Absence of Garbage Collector
As discussed earlier, C++ gives the user complete
control of managing the computer memory using DMA. C++ lacks the feature of a
garbage collector to automatically filter out unnecessary data.
As discussed earlier, C++ gives the user complete
control of managing the computer memory using DMA. C++ lacks the feature of a
garbage collector to automatically filter out unnecessary data.
4. Absence of Built-in Thread
C++ does not support any built-in threads. Threads is
a relatively new concept in C++ which wasn’t initially there. Now, C++ is
capable of supporting lambda functions.
C++ does not support any built-in threads. Threads is
a relatively new concept in C++ which wasn’t initially there. Now, C++ is
capable of supporting lambda functions.
No comments:
Post a Comment