Page 1 of 1

Structured Cobol Programming and Object Oriented COBOL...

Posted: Sun Aug 04, 2013 10:54 pm
by Ramnath
What is the difference between Structured Cobol Programming and Object Oriented COBOL programming?

Re: Structured Cobol Programming and Object Oriented COBOL..

Posted: Mon Aug 05, 2013 3:02 pm
by Robert Sample
You are comparing apples to elephants. Structured programming is a concept that goes back to Dijkstra's 1968 letter to the Communications of the ACM where he suggested that the GOTO statement was not necessary and actually harmful to logic processes. Use of PERFORM statements in COBOL replace GOTO statements in structured programs.

Object-oriented programming looks at programs as objects that contain data (attributes) and have associated procedures (methods). Those associated procedures could be written using structured programming techniques, or they could be written using GOTO statements all over the place.

Re: Structured Cobol Programming and Object Oriented COBOL..

Posted: Fri Aug 09, 2013 5:15 pm
by Anuj Dhawan
To start with, the differences are the same as any OO vs. non-OO language. OO COBOL provides support for CLASS and Objects by providing the syntax and API's (Application programming Interface) required managing those.

The main difference is that structured programming deals with the flow of execution and not, primarily, with the data (as opposed (or just different) to OOCOBOL). Structured Programming technique got it roots starting from the need of removing arbitrary jumps (GOTOs) and favored code blocks and functions. Structured programming mainly deals with the organization of the code and not with the data. By definition, "pure structured programming" let the data flow around in the form of function arguments.
In contrast, object oriented programming primarily deals with data issues. In a pure object oriented approach, the flow of program execution is mainly on "objects" and so the flow is treated as bits of behavior associated with the packets of data that are nothing but "objects".

Said all that - they are pretty much different flavors altogether and are very different to be compared, as Robert has also said.

Re: Structured Cobol Programming and Object Oriented COBOL..

Posted: Mon May 19, 2014 4:52 pm
by Ramnath
Thanks Robert and Anuj...