locked
what is the advantage of oop over procedural language with example RRS feed

  • Question

  • User87195929 posted

    Hi all

    i want to know what is the advantage of oop over procedural language with example

    and how memory is allocated for objects of classes

     thanks and regards

    siddu

    Wednesday, January 31, 2018 11:58 AM

All replies

  • User475983607 posted

    siddangoud

    Hi all

    i want to know what is the advantage of oop over procedural language with example

    and how memory is allocated for objects of classes

     thanks and regards

    siddu

    There is not answer to the this question as it will just cause a debate. 

    OOP just provides a method for organizing code.

    Wednesday, January 31, 2018 12:02 PM
  • User753101303 posted

    Hi,

    The basic idea is to gather data and methods. For example in the past you had long list of functions such as https://msdn.microsoft.com/en-us/library/windows/desktop/aa364232(v=vs.85).aspx possibly in a single "namespace". You then created a separate "file handle" variable you had to pass to various file methods (and you could quite easily pass the wrong value or even some other kind of handle).

    If you had complex data you were handling data on one side and functions working on those data on the other side.

    With data are part of the object you are dealing with (for example as https://msdn.microsoft.com/en-us/library/system.io.filestream.handle(v=vs.110).aspx ). A side effect is that it the object.method syntax allows to narrow down much more easily which operations(could be done (basically in the past it was "method(objectData)")

    You have detailed articles about memory management but I don't find those I wanted right now. Note sure it's that interesting. Maybe if you narrow down your question it will be easier to point you to an article that better fit what you want...

    Wednesday, January 31, 2018 12:24 PM