
COBOL Good Coding
Good COBOL coding practice take you to next level in your career. In COBOL greater than spaces and not equal to spaces is one interesting point. Recently in our project there was a discussion, which is the best method to follow.
COBOL Good Coding Examples
Let me take an example,
IF X NE SPACES and LOW-VALUES
THEN
do whatever…
END-IF
In the above example, used not equal to for both spaces and low-values. The way using negative condition is difficult to understand by programmers. Also, you are giving two conditions by using and -this is also not good practice of COBOL programming.
Revised example is:
IF X GT SPACES or X NE LOW-VALUES
THEN
do whatever…
END-IF
The above revised coding example does make sense, and easy to understand by other programmers. And, there is no confusion.
Related Posts
Get new content delivered directly to your inbox.
You must be logged in to post a comment.