javac++object-oriented-analysisprocedural

Is it correct to make this affirmations about OOP and Procedural Programming?


I had to do a true or false homework here, and I have my doubts with these three things I've been reading but the more I read the more kind of confused I get. Here are my conclusions I hope you can help me understand better.

1) "Object-oriented design is hard because object-oriented technologies are tied close to peoples mental models". I find this true because OOP is a way for humans to see problems and its solution.

2) "in object-oriented programming a complex system is decomposed into a hierarchy of collaborating objects". I said it's true but I have my doubts, because I'm not sure if its right to say collaborating "objects" I feel like it should be components or something different but at the same time I understand that in OOP objects of a class collaborate with objects of another class.

3) Finally "procedural programs are easier to design than object-oriented programs" I said it was true but I'm not sure why what I was reading was that in procedural the programmer writes like a history, he just goes on programming the solution and doesn't make a full model of it, he uses something called "top-down" and yeah that's what I caught that procedural is easier to design but harder to make changes while OOP is harder to design but easier to make changes.


Solution

  • 1) I think your reason is a reason for saying that OOP is NOT hard.

    2) For me "components" are pieces of software (very context-specific definition of the term).
    Each component defines one or more (maybe even zero) classes of objects. Objects are instances of classes. What is actually collaborating are the objects, behaving as defined by their classes, which are coded in components.

    3) It might be easier to design a procedural program than an OOP program (in seeming contrast to 1) ), if your programming thinking is "I want to have this happen". If you are able to put the human thinking models into design and then into code, OOP is easier.
    Hard to say, but cynically I would answer "No", just because anybody teaching OOP and making an exam for it will probably have spent a year to tell you that OOP is better in each and every aspect. (Excuse the exaggeration of how extreme the teacher is. The better they are, the more balanced the teachings will of course be.)