Structured Cobol Programming and Object Oriented COBOL...

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Ramnath
Registered Member
Posts: 20
Joined: Thu Aug 01, 2013 6:57 pm

Structured Cobol Programming and Object Oriented COBOL...

Post by Ramnath »

What is the difference between Structured Cobol Programming and Object Oriented COBOL programming?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1898
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Structured Cobol Programming and Object Oriented COBOL..

Post 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.
User avatar
Anuj Dhawan
Founder
Posts: 2807
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Structured Cobol Programming and Object Oriented COBOL..

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Ramnath
Registered Member
Posts: 20
Joined: Thu Aug 01, 2013 6:57 pm

Re: Structured Cobol Programming and Object Oriented COBOL..

Post by Ramnath »

Thanks Robert and Anuj...
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”