View previous topic :: View next topic
|
Author |
Message |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Hi friends,
I would like know what are things need to following while writing cobol programs..
Like : 1) Avoid INTIALIZE table group variable
2) Try to use avoid Evaluate etc |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
First and foremost: FOLLOW YOUR SITE STANDARDS!
Be aware that site standards vary from site to site, so what is not allowed at one site will be mandated at another site. And if you follow site standards, they may contradict anything you are told on this forum so you will need to filter every response against the site standards for your site. There is nothing inherently "good" or "bad" about INITIALIZE or EVALUATE or any other COBOL verb -- there are times when they should be used and times when they should not. Your goal should be to produce clear code that accomplishes the needed task. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Difficult, as Robert has indicated. Within the scope of the standards, people often have their own "style" (or lack of it).
Avoid bad code.
Don't use "NEXT SENTENCE" with a "scope-delimiter", like END-IF or END-SEARCH or anything. Use CONTINUE.
In Production:
Don't do "clever" things which others won't understand.
Don't do things which rely on things which you are not supposed to rely on but happen to work for now.
Don't do things which won't pass an Audit.
CYA.
If the spec says it can never happen but disaster will ensue if it does, abend with appropriate and accurate messages. It'll never happen, remember :-)
Don't change a line of code without a spec for the change. If something looks "wrong", raise it as an issue - but don't just change it. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
"Don't do "clever" things which others won't understand. "
My biggest fault. Just yesterday I took a smart job step I had written and replaced it with three dumb ones that anyone could understand.
It's not because other people CAN'T figure it out, it's that the shouldn't HAVE to. |
|
Back to top |
|
|
|