This question is open to everyone, and I would appreciate your responses on these.
1) Can someone tell me what their professional opinion of (and their installation's standards/guidelines on) the use of explicit scope terminators like END-IF/ENDIF? I use them because they're clear and (as their title says) they explicitly terminate the scope of a sequence of code. It makes nested IF's much easier to follow for me. My impression of them is that they MUST'VE been useful to others, since they were added to COBOL in its later variants.
My teammates at work hate them and I'm being run into the ground on it. They'd rather use periods, indentations, and NEXT SENTENCEs as indicators. They're mostly older programmers who are pretty set in their ways/opinions. (To add to their intractability, we don't get along that well.)
2) For another example (and one I'd like your input on as well): I tried to suggest using an EVALUATE statement for a segment of code where they had to consider each digit of a string, and they shot me down, even though it would've reduced the code by a third or more. They preferred using a nested IF structure, but unindented in a "Case-like" format. For example:
IF condition a
statement
ELSE
If condition b
statement
ELSE
IF condition c
statement
(etc)...
On the other hand, here's how EVALUATE would look
EVALUATE variable
WHEN condition a
statement
WHEN condition b
statement
WHEN condition c
statement
(etc)...
To me, it makes for cleaner, more understandable code...but they argue that their way is better. When I suggested the use of EVALUATE (which they weren't familiar with), I got shot down. To me, it seems that everyone else is hell-bent on maintaining THEIR preferences, regardless of what may actually be better or may follow more standard practice elsewhere.
Maybe I'm the crazy one. I'd appreciate you guys letting me know.
1) Can someone tell me what their professional opinion of (and their installation's standards/guidelines on) the use of explicit scope terminators like END-IF/ENDIF? I use them because they're clear and (as their title says) they explicitly terminate the scope of a sequence of code. It makes nested IF's much easier to follow for me. My impression of them is that they MUST'VE been useful to others, since they were added to COBOL in its later variants.
My teammates at work hate them and I'm being run into the ground on it. They'd rather use periods, indentations, and NEXT SENTENCEs as indicators. They're mostly older programmers who are pretty set in their ways/opinions. (To add to their intractability, we don't get along that well.)
2) For another example (and one I'd like your input on as well): I tried to suggest using an EVALUATE statement for a segment of code where they had to consider each digit of a string, and they shot me down, even though it would've reduced the code by a third or more. They preferred using a nested IF structure, but unindented in a "Case-like" format. For example:
IF condition a
statement
ELSE
If condition b
statement
ELSE
IF condition c
statement
(etc)...
On the other hand, here's how EVALUATE would look
EVALUATE variable
WHEN condition a
statement
WHEN condition b
statement
WHEN condition c
statement
(etc)...
To me, it makes for cleaner, more understandable code...but they argue that their way is better. When I suggested the use of EVALUATE (which they weren't familiar with), I got shot down. To me, it seems that everyone else is hell-bent on maintaining THEIR preferences, regardless of what may actually be better or may follow more standard practice elsewhere.
Maybe I'm the crazy one. I'd appreciate you guys letting me know.