19

COBOL is something I use at work. Typically, you see IF blocks like this

IF condition
Stuff
END-IF.

But the END-IF part if actually optional. You can just use a period and it does the same thing.

IF condition
Stuff.

Many headaches if not caught when reading.

Comments
  • 1
    I find it worse that some implementations have e.g. DISPLAY as a "block" (e.g. DISPLAY whatever END-DISPLAY; alternatively terminated with a .) and some don't even understand END-DISPLAY.

    Btw. "." is the original way to end statements, before END- was introduced.
  • 1
    @sbiewald If it was consistent I wouldn't care. But we have several multi thousand line program that sometimes omit the end if and sometimes use it.
  • 2
    I worked for 1.5 years with Cobol. And I didn’t even have the right to use “advanced” features like calls and returns. Everything needed to be done with GOTOs. Because other devs (age average of 60, I was 23) couldn’t understand the concept.
    I decided to purge these 1.5 tears from my resume. Put personal projects instead. One of which was : A cobol code generator from a simple WYSIWG tools I made to design the flow.
  • 2
    Such mixed feelings about color. I truly miss 88 levels. Don't miss the absence of good tooling.
  • 2
    @SortOfTested
    Color, wtf phone 😸 Cobol. Damnit
  • 1
    @orseji

    We use numbered blocks

    10000-
    20000-
    30000-

    When methods meet to go in-between they take the half. Works okay.
Add Comment