The main advantage is the more abstract level and the principal feature is the implementation inheritance.But it is the disadvantage at the same time because of required programmer skill's level too.
The main disadvantage is that procedural "spaghetti" code is easier to restructure (refactor) but OO "spaghetti" is much harder to understand and modify. The "Patterns Hell" is my own term of such case since many years in software engineering.
In a very general sense, the advantage of OO programing is code reuse. Because OOP creates code "objects", those objects (source code) can be reused in many projects / applications.
You can find many advantages when using OOP for any scenario. And the probability of disadvantage it literally nil in most of the case studies where I used it.
There are many advantages to OOPs than disadvantages, and some are arguably be both. If your main objective is to learn OOPs then do not worry about the adv. and disadv. at this stage. You will figure this out on your own once you get some understanding of what OOPs really is.
Also, having an advantage or disadvantage of any technology is clearly based on your problem statement. What seem to be an advantage for one problem statement might be a disadvantage for another.
Do not worry about this too much, just give it a try.
You will see some specific characteristic like "encapsulation", "polymorphism", "inheritance" .... but then you have to learn and practice to really understand the concepts.
If you need help to kick off, some MOOCs like coursera offer free lectures on the subject : https://www.coursera.org/courses?query=object%20oriented%20programming&languages=en
With OOP you can structure your program in a sound way. The world consist of objects with different properties and they are interacting via information exchange. The OOP paradigm give you the possibility to model the world or a domain in your program like the interacting objects in the real world. I think that was the main intention behind the OOP paradigm.
Everything in programming bothers on the use of variables and functions ( or procedures) to process the various entities of an information system. In Procedural programming, the variables and functions are declared and used differently; thus, it becomes very difficult to match a given function to a particular entity. But in Object-Oriented programming, the variables and functions of various entities called objects are declared collectively with the use of classes so that a constructor can be used to create each of those objects. When this has been done, it becomes very easy to manipulate each object with the command, object.method(). Therefore, in object-oriented programming, every created object exists in memory, and any of its methods (or actions) can easily be accesed with the command, object.method() so that we can easily tell which object performed a particular function. This functionality is not obtainable in Procedural Programming.
Disadvantages of Object-Oriented Programming
The major disadvantage of Object-Oriented programming is that, it demands quite a lot of memory spaces from the computer (just like Recursion) to store information about the various object-class instances used in a program.
The main advantage of oop is data security. Data can be handled through the objects. The important features of oop like abstraction, encapsulation, polymorphism, inheritance are really helpful when we program for real world applications.
The disadvantage is: It is difficult to understand for beginners.
There is many advantages of OOP, but, one disadvantage. The full OOP programs are much more laborious at the beginning. So, when your program need not be very complicated and you not expected to develop many versions of it (for example - simple simulation program or concept proof of new statistical/network algorithm) you can make procedure oriented program. In C++ you can make program with any type of paradigm - structural, functional, OOP and any hybrid of them. You can quite easily convert structural/procedural program into OOP, if such work appear to bee profitable.
I made a lot of unneeded code, before I reached this wisdom :-)
Advantages: when your problem domain can be clearly defined as classes (or sets) of objects interacting thru messages, it's great, you can abstract the problem and solve it in a sound way. Disadvantages: when your problem domain is not about objects and you start trying to fit a square peg into a round hole, and the end product is a mess.
Advantages: OOP improved your software development productiviy by provideing you with modularity , reuseability and extensibility. You can do fast development by reusing your codes. OOP also help you in configuration management
Disadvantages: It take more lines of code then procedural programs. It can take time to get use to object Oriented Programming
The main advantages of OOP are: The reuse of software made lower cost of development. Typically, more effort is put into the object-oriented analysis and
design, which lowers the overall cost of development.
OOP provides you with high quality of the Software faster development of software and lower cost of development allows more time and resources to be used in the verification of the software. Although quality is dependent upon the experience of the teams, object oriented programming tends to result in higher-quality software.
The main disadvantages of OOP are:
Size: Object Oriented programs are much larger than other programs. In the early days of computing, space on hard drives, floppy drives and in memory were at a premium. Today we do not have these restrictions.
Effort: Object Oriented programs require a lot of work to create. Specifically, a great deal of planning goes into an object oriented program well before a single piece of code is ever written. Initially, this early effort was felt by many to be a waste of time. In addition, because the programs were larger (see above) coders spent more time actually writing the program.
Speed: Object Oriented programs are slower than other programs, partially because of their size. Other aspects of Object Oriented Programs also demand more system resources, thus slowing the program down.
Dear Nazar, well designed & written C++ program (especially using good, professional libraries and templates) is almost as fast as pure C.
In fact this is the only one language, in which you can compare this things.
Other OO languages are too pure, and much slower, but not because OOP. Just because language "implementation model": virtual machine, hidden pointers, garbage collectors, dynamic classes etc.) make considerable costs.
Simply before I list down the advantage and disadvantage of object oriented programming, you should know the main different between OOP and the procedural programming, this way will let you get the main idea about OOP and why we are using it.
Procedural programming: it is a programming paradigm, derived from the structured programming, based upon the concept of the procedure call, however, it is a list of instructions to tell the computer what to do exactly step by step, called Top Down programming (imperative programming). One of the most important characteristic of the procedural programming that is realized on procedures, routines, and subroutines that perform data. For example; procedural programming such as FORTRAN, COBOL, and C.
“Programming paradigm is the fundamentally different approaches to building solutions for specific types of problems.”
Object Oriented Programming: it is also programming paradigm, which is an approach to problem solution where all computations are carried out using “Objects”. The object is a component of a program that knows how to perform certain actions and how to interact with other elements of the program. For example, OOP programming such as C#, Python, Java, and Perl. Moreover, both procedures and data are two different concepts, but together in OOP means Objects.
List of OOP advantages:
1- Code reuse and recycling: Objects created for OO programs can easily be reused in other programs.
2- Encapsulate as part 1: Once an object is created, knowledge of its implementation is not necessary for its use, however, in older programs, coder needed to understand all the details of the pieces of code step by step before using it.
3- Encapsulate as part 2: Objects have the ability to hide certain parts of themselves from the programmers.
4- Design Benefits: Large programs are very difficult to write however, OO programs force designers to go through extensive planning phase, which makes better designs with fewer flaws. In addition, once a program reaches a certain size, OO Programs are actually very easier to program than non-object oriented ones.
5- Software Maintenance: Programs are not disposable. Legacy code must be dealt with on a daily basis, either to be improved upon (for a new version of an exist piece of software) or made to work with newer computers and software. Thus, an OO Program is much easier to maintain and modify than a non-OO Program.
List of OOP disadvantages:
1- Size: OO programs are much larger than other programs. In the early days of computing, space on hard drives, floppy drives and in memory was at a premium. Today we do not have these restrictions.
2- Effort: OO programs require a lot of work to create. For example, a great deal of planning goes into an object oriented program well before a single piece of code is ever written.
3- Speed: OO programs are slower than other programs, partially because of their size. Other aspects of OO Programs also demand more system resources, thus slowing the program down.
In addition to the previous answer, we can say also that OOP is a well-adopted programming style that uses interacting objects to model and solve complex programming tasks. However, there are two examples of popular OO programming languages are Java and C++. Some other well-known object-oriented programming languages include Objective-C, Perl, Python, Javascript, Simula, Modula, Ada, Smalltalk, and the Common Lisp Object Standard.
Basically, some other OOP advantages include:
1- Improved software development productivity: OO programming is modular, as it provides separation of duties in object-based program development. It is also extensible, as objects can be extended to include new attributes and behaviors. Objects can also be reused within an across applications. Because of these three factors; extensibility, modularity, and reusability.
2- Faster development: Reuse enables faster development. Object-oriented programming languages come with rich libraries of objects, and code developed during projects is also reusable in future projects.
3- Lower cost of development: The reuse of software also lowers the cost of development. Typically, more effort is put into the OO analysis and design, which lowers the overall cost of development.
4- Higher-quality software: Faster development of software and lower cost of development allows more time and resources to be used in the verification of the software. Although quality is dependent upon the experience of the teams, OO programming tends to result in higher-quality software
Other OOP disadvantages are:
1- Steep learning curve: The thought process involved in OO programming may not be natural for some people, and it will take the time to get used to it.
2- The complexity of creating programs: it is very complex to create programs based on the interaction of objects. Some of the key programming techniques, such as inheritance and polymorphism, can be a big challenging to comprehend initially.
In my opinion it could be faster, cheaper, better etc..., if you follow somebody more clever, who resolved problems with particular class of applications and made good reusable code for you.
But if your task is new or unique, it is not the case :-)