Quote:Original post by Alastair Gould
You should not mix OO and procedural methods of programming.
I respectfully disagree.
Quote:Original post by Alastair Gould
You should not mix OO and procedural methods of programming.
Quote:Original post by TelastynQuote:Original post by Alastair Gould
You should not mix OO and procedural methods of programming.
I respectfully disagree.
Quote:Original post by jonathanjanssonVirtual functions are the core of polymorphism in C++. Polymorphism is just one aspect of OOP, others include encapsulation, modularity, inheritance, abstraction, SRP, LSP OCP and ISP.
Virtual functions are the very core of OOP programming. At least in C++.
Quote:It is often said that OOP is about hiding information but I think this is wrong. The point is to hide the way that information is stored.This is encapsulation.
Quote:An std::vector is not hiding the information that you put inside it but it makes the handling of the data easier and safer.Of course a std::vector is really a better example of generic programming rather than object oriented programming. Also, a std::vector does hide the implementation details of a dynamic array and associated memory management.
Quote:
Trying to design a program formally on paper you will realise designing procedurally has completely different steps and methods than OO.
Quote:
I used to think that OO and procedural methods can mixed, but now being taught formally has taught me why this can be a bad method.
Quote:Original post by dmatter
@jonathanjansson: Whilst you're largely right, just some comments...Quote:Original post by jonathanjanssonVirtual functions are the core of polymorphism in C++. Polymorphism is just one aspect of OOP, others include encapsulation, modularity, inheritance, abstraction, SRP, LSP OCP and ISP.
Virtual functions are the very core of OOP programming. At least in C++.Quote:It is often said that OOP is about hiding information but I think this is wrong. The point is to hide the way that information is stored.This is encapsulation.Quote:An std::vector is not hiding the information that you put inside it but it makes the handling of the data easier and safer.Of course a std::vector is really a better example of generic programming rather than object oriented programming. Also, a std::vector does hide the implementation details of a dynamic array and associated memory management.
Quote:Original post by jonathanjansson
I am not familiar with those abbrevations, maybe if you spell them out i will know them?
Quote:Another iteresting thought it that if you would replace all private: and protected: declarations with public:, would the code not be object oriented anymore?